VS 2008 调出控件工具栏的方法

展开阅读全文
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符

vs2008 menu控件子菜单显示不出来

03-12

前台代码: <asp:Menu ID="menuNav" runat="server" BackColor="#42BAB6" DynamicHorizontalOffset="2" Font-Names="宋体" Font-Size="9pt" ForeColor="White" Orientation="Horizontal" StaticSubMenuIndent="10px" OnMenuItemClick="menuNav_MenuItemClick" DynamicPopOutImageTextFormatString="" Height="22px" Width="658px"> <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" /> <DynamicHoverStyle BackColor="#666666" ForeColor="White" /> <DynamicMenuStyle BackColor="#42BAB6" /> <StaticSelectedStyle BackColor="#1C5E55" /> <DynamicSelectedStyle BackColor="#1C5E55" /> <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" /> <Items> <asp:MenuItem Text="首页" Value="首页" NavigateUrl="~/Default.aspx"></asp:MenuItem> <asp:MenuItem Text="系统设置" Value="系统设置" Enabled="False"> <asp:MenuItem Text="图书馆信息" Value="图书馆信息" NavigateUrl="~/SysSet/LibraryInfo.aspx"></asp:MenuItem> <asp:MenuItem Text="管理员设置" Value="管理员设置" NavigateUrl="~/SysSet/AdminManage.aspx"></asp:MenuItem> <asp:MenuItem Text="书架管理" Value="书架设置" NavigateUrl="~/SysSet/BCaseManage.aspx"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="读者管理" Value="读者管理"> <asp:MenuItem Text="读者类型管理" Value="读者类型管理" NavigateUrl="~/ReaderManage/RTypeManage.aspx"></asp:MenuItem> <asp:MenuItem Text="读者档案管理" Value="读者档案管理" NavigateUrl="~/ReaderManage/ReaderManage.aspx"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="图书管理" Value="图书管理"> <asp:MenuItem Text="图书类型管理" Value="图书类型管理" NavigateUrl="~/BookManage/BTypeManage.aspx"></asp:MenuItem> <asp:MenuItem Text="图书档案管理" Value="图书档案管理" NavigateUrl="~/BookManage/BookManage.aspx"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="图书借还" Value="图书借还"> <asp:MenuItem Text="图书借阅" Value="图书借阅" NavigateUrl="~/BookBRManage/BorrowBook.aspx"></asp:MenuItem> <asp:MenuItem Text="图书归还" Value="图书归还" NavigateUrl="~/BookBRManage/ReturnBook.aspx"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="系统查询" Value="系统查询"> <asp:MenuItem Text="图书档案查询" Value="图书档案查询" NavigateUrl="~/SysQuery/BookQuery.aspx"></asp:MenuItem> <asp:MenuItem Text="图书借阅查询" Value="图书借阅查询" NavigateUrl="~/SysQuery/BBorrowQuery.aspx"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="排行榜" Value="排行榜"> <asp:MenuItem Text="图书借阅排行榜" Value="图书借阅排行榜" NavigateUrl="~/SortManage/BookBorrowSort.aspx"></asp:MenuItem> <asp:MenuItem Text="读者借阅排行榜" Value="读者借阅排行榜" NavigateUrl="~/SortManage/ReaderBorrowSort.aspx"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="更改口令" Value="更改口令" NavigateUrl="~/Common/ChanagePwd.aspx"></asp:MenuItem> <asp:MenuItem Text="退出系统" Value="退出系统"></asp:MenuItem> </Items> <StaticHoverStyle BackColor="#666666" ForeColor="White" /> </asp:Menu> 后台代码: protected void Page_Load(object sender, EventArgs e) { if (Session["role"] == "Reader") { menuNav.Items[1].Enabled = false; menuNav.Items[2].Enabled = false; menuNav.Items[3].Enabled = false; menuNav.Items[5].Enabled = false; } else { if (Session["Name"] != null) { labAdmin.Text = Session["Name"].ToString(); adminmanage.Name = Session["Name"].ToString(); } DataSet adminds = adminmanage.GetAllAdminByName(adminmanage, "tb_admin"); string strAdminID = adminds.Tables[0].Rows[0][0].ToString(); purviewmanage.ID = strAdminID; DataSet pviewds = purviewmanage.FindPurviewByID(purviewmanage, "tb_purview"); bool sysset = Convert.ToBoolean(pviewds.Tables[0].Rows[0][1].ToString()); bool readset = Convert.ToBoolean(pviewds.Tables[0].Rows[0][2].ToString()); bool bookset = Convert.ToBoolean(pviewds.Tables[0].Rows[0][3].ToString()); bool borrowback = Convert.ToBoolean(pviewds.Tables[0].Rows[0][4].ToString()); bool sysquery = Convert.ToBoolean(pviewds.Tables[0].Rows[0][5].ToString()); if (sysset == true) { menuNav.Items[1].Enabled = true; } else { menuNav.Items[1].Enabled = false; } if (readset == true) { menuNav.Items[2].Enabled = true; } else { menuNav.Items[2].Enabled = false; } if (bookset == true) { menuNav.Items[3].Enabled = true; } else { menuNav.Items[3].Enabled = false; } if (borrowback == true) { menuNav.Items[4].Enabled = true; } else { menuNav.Items[4].Enabled = false; } if (sysquery == true) { menuNav.Items[5].Enabled = true; } else { menuNav.Items[5].Enabled = false; } } } protected void menuNav_MenuItemClick(object sender, MenuEventArgs e) { if (menuNav.SelectedValue == "退出系统") { Response.Write("<script>window.close();</script>"); } } 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览