protected void gvReports_RowDeleting(object sender, GridViewDeleteEventArgs e) { if (Utils.LoggedUser == null) { Response.Redirect("~/login"); } if (Utils.CheckPermission(4, 10, Utils.LoggedUser.Roles) < 1) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", @" noty({ type: 'error', text: '" + GetGlobalResourceObject("MessagesResource", "X_NotAuthorized") + @"', layout: 'center', closeWith: ['click', 'backdrop'], modal: true, killer: true });", true); e.Cancel = true; return; } int affectedRows = MgrReports.Delete(int.Parse(e.Keys["ReportID"].ToString())); if (affectedRows > 0) { btnSearch_Click(sender, e); } e.Cancel = true; }