protected void updateButton_Click(object sender, EventArgs e) { AppMenuBLL appMenu = new AppMenuBLL(); try { if (menuGroupNameTextBox.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Menu Group Name field is required."; } else if (displayNameTextBox.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Display Name field is required."; } else if (urlTextBox.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Menu URL field is required."; } else if (menuTypeDropDownList.Text == "----------Select----------") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Menu Type field is required."; } else if (menuForAppDropDownList.Text == "----------Select----------") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Menu For App. field is required."; } else { appMenu.MenuGroupId = idLabel.Text.Trim(); appMenu.MenuGroupName = menuGroupNameTextBox.Text.Trim(); appMenu.DisplayName = displayNameTextBox.Text.Trim(); appMenu.ToolTipDescription = descriptionTextBox.Text.Trim(); appMenu.URL = urlTextBox.Text.Trim(); appMenu.MenuType = menuTypeDropDownList.SelectedValue.Trim(); appMenu.MenuForApp = menuForAppDropDownList.SelectedValue.Trim(); appMenu.MenuTarget = menuTargetDropDownList.SelectedValue.Trim(); appMenu.ImageUrl = imageURLTextBox.Text.Trim(); if (!appMenu.CheckDuplicateMenuGroup(menuGroupNameTextBox.Text.Trim())) { appMenu.UpdateMenuGroup(); appMenuGroupIdForUpdateHiddenField.Value = ""; appMenuGroupNameHiddenField.Value = ""; MyAlertBox("alert(\"Menu Group Updated Successfully.\"); window.location=\"/UI/AppMenu/MenuGroupList.aspx\""); } else { if (appMenuGroupNameHiddenField.Value == menuGroupNameTextBox.Text.Trim()) { appMenu.MenuGroupName = "WithOut"; appMenu.UpdateMenuGroup(); appMenuGroupIdForUpdateHiddenField.Value = ""; appMenuGroupNameHiddenField.Value = ""; MyAlertBox("alert(\"Menu Group Updated Successfully.\"); window.location=\"/UI/AppMenu/MenuGroupList.aspx\""); } else { msgbox.Visible = true; msgTitleLabel.Text = "Data Duplicate!!!"; msgDetailLabel.Text = "This Menu Group already exist, try another one."; } } } } catch (Exception ex) { msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } finally { appMenu = null; } }