protected void chkShow_CheckedChanged(object sender, EventArgs e) { try { CheckBox chk = (sender as CheckBox); GridViewRow row = (GridViewRow)(((CheckBox)sender).NamingContainer); HiddenField hdnCheck = (HiddenField)row.Cells[4].FindControl("hiddenField1"); mainmenu = new MainMenuBLL(); if (mainmenu.UpdateStatus(Convert.ToInt32(hdnCheck.Value), chk.Checked)) { this.load_gwMenuItems(); } } catch (Exception ex) { this.AlertPageValid(true, ex.ToString(), alertPageValid, lblPageValid); } }