Exemple #1
0
 protected void btnEliminarMenu_Click(object sender, EventArgs e)
 {
     try
     {
         int id = Convert.ToInt32(hfCode.Value);
         using (ControladorMenus c_menu = new ControladorMenus())
         {
             c_menu.EliminarMenu(id);
         }
         bindGrid();
         System.Text.StringBuilder sb = new System.Text.StringBuilder();
         sb.Append(@"<script type='text/javascript'>");
         sb.Append("$('#deleteModal').modal('hide');");
         sb.Append(@"</script>");
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "delHideModalScript", sb.ToString(), false);
         PanelMensaje.Visible = true;
         LabelMensaje.Text    = "Menu Eliminado con Exito";
     }
     catch (ExcepcionPropia ex)
     {
         System.Text.StringBuilder sb = new System.Text.StringBuilder();
         sb.Append(@"<script type='text/javascript'>");
         sb.Append("$('#deleteModal').modal('hide');");
         sb.Append(@"</script>");
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "delHideModalScript", sb.ToString(), false);
         PanelError.Visible = true;
         lblError.Text      = ex.Message;
     }
 }