protected void del_Command(object sender, CommandEventArgs e) { if (e.CommandName == "ghDel") { for (int item = 0; item < repCate.Items.Count; item++) { Label lb = repCate.Items[item].FindControl("lblidcat") as Label; if (lb.Text == e.CommandArgument.ToString()) { if (cl.DeleteCate(Convert.ToInt32(lb.Text))) { loadCate(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Delete Complete')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Delete Fail')", true); } } } } }