protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { string strMessage = string.Empty; string strCheck = string.Empty; string strScript = string.Empty; string strUpdatedBy = Session["username"].ToString(); Label lblperson_code = (Label)GridView1.Rows[e.RowIndex].FindControl("lblperson_code"); HiddenField hdduserID = (HiddenField)GridView1.Rows[e.RowIndex].FindControl("hdduserID"); cUser oUser = new cUser(); try { if (!oUser.SP_USER_DEL(hdduserID.Value.ToString(), ref strMessage)) { lblError.Text = strMessage; } } catch (Exception ex) { lblError.Text = ex.Message.ToString(); } finally { oUser.Dispose(); } BindGridView(0); }