protected void GetPrivilegedMenuByUser() { AppMenuBLL appMenuBLL = new AppMenuBLL(); try { groupWiseUserMenuListListBox.Items.Clear(); DataTable dt = appMenuBLL.GetPrivilegedMenuByUser(userIdLabel.Text.Trim(), menuForAppDropDownList.SelectedValue.Trim(), menuTypeDropDownList.SelectedValue.Trim(), menuGroupDropDownList.SelectedValue.Trim()); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { groupWiseUserMenuListListBox.Items.Add(new ListItem(dt.Rows[i]["MenuName"].ToString(), dt.Rows[i]["MenuId"].ToString())); } } } catch (Exception ex) { msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } finally { appMenuBLL = null; countUserMenuLabel.Text = "Total: " + groupWiseUserMenuListListBox.Items.Count.ToString(); } }