protected void Unnamed_Command(object sender, CommandEventArgs e) { if (e.CommandName == "ghUpdate") { for (int item = 0; item < repCate.Items.Count; item++) { Label lb = repCate.Items[item].FindControl("lblidcat") as Label; TextBox tb = repCate.Items[item].FindControl("txtCateName") as TextBox; if (lb.Text == e.CommandArgument.ToString()) { ca = cl.getCate(int.Parse(lb.Text)); if (ck.checkstringnull(tb.Text)) { ca.cat_name = tb.Text; cl.UpdateCate(ca); loadCate(); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Please Type Your Category')", true); } } } } }