public void DeleteItem(object sender, System.EventArgs e) { String id = ((HtmlAnchor)sender).HRef.ToString(); int i = AbBahaClass.Delete(Convert.ToInt32(id)); if (i == 0) { LblMsg.Text = " error "; ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('خطا در حذف');", true); } else { BindGrid(); } LightBox.Value = "0"; }