在ASP.NET MVC3中使用Jquery的侧面菜单

问题描述:

我是asp.net mvc和Jquery的新手.

我想在每个页面中显示辅助菜单.
此补充菜单应通过从数据库获取值列表来动态绑定.
即将它们绑定为锚标签.单击每个链接时,需要重定向到相应的视图.

我用谷歌搜索,但没有找到解决方法.

请指导我.

在此先感谢

I am new to asp.net mvc and Jquery.

I want to display sidemenu in each and every page.
This sidemenu should bind dynamically by getting list of values from database.
i.e bind them as an anchor tags. When clicking on each link need to redirect to corresponding views.

I googled it but i didn''t find solution.

Please guide me.

Thanks in advance

使用.Ascx文件(webusercontrol)创建左侧"菜单,而在内部Ascx.cs文件中编写数据库操作

Use .Ascx files(webusercontrol) to create the Left menu and Inside Ascx.cs file write the data base actions

<asp:Menu ID="Menu1" DataSourceID="xmlDataSource" runat="server"

            DynamicHorizontalOffset="2" StaticSubMenuIndent="10px" Width="145px"

        OnMenuItemClick="Menu1_MenuItemClick" >

          <DataBindings>
            <asp:MenuItemBinding DataMember="MenuItem"

             TextField="Text" ToolTipField="ToolTip" />
       
       </asp:Menu>




您必须使用xmlDataSource(.xsl文件)列出菜单




You have to use xmlDataSource (.xsl file) to list menus