在ASP.NET MVC3中使用Jquery的侧面菜单 [英] Side menu using Jquery in asp.net mvc3

查看:48
本文介绍了在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


这篇关于在ASP.NET MVC3中使用Jquery的侧面菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆