将菜单绑定到sql数据库 [英] binding a menu to a sql database

查看:110
本文介绍了将菜单绑定到sql数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我想创建一个垂直菜单来显示类别和子类别.
菜单将分为三个步骤,例如Monitor-> LED或LCD->然后标记显示器.
我有三个表(类型,产品,子产品).我需要此菜单的代码.
我搜索了,但是找不到合适的东西.我需要C#代码,并希望从sql数据库绑定数据.

非常感谢您的帮助,

hello,
I want to create a vertical menu to show categories and subcategories.
the menu will have three steps, for example Monitor--> LED or LCD --> and then mark of the monitor.
I have three tables(Types, Products, sub products). I need the code for this menu.
I searched but I couldn''t find any thing suitable. I need C# code and want to bind data from sql database.

thanks alot for helping,

推荐答案

您最好的选择是创建自己的站点地图提供程序.在这种情况下可以使用sqlSiteMapProvider.

http://msdn.microsoft.com/en-us/magazine/cc163657.aspx [ ^ ]

本质上,上面的链接是如何通过继承基本站点地图提供程序(无论如何)来创建站点地图提供程序,以创建sql版本.您应该能够从中获得所需要做的事情.

您还可以使用:
创建一个更基本的版本
使用数据库绑定菜单控件 [在ASP.NET 2.0中填充菜单控件-使用不同的数据源 [ http://aspdotnetcodebook.blogspot.co.uk/2008/04/how-to-create-database-driven-menu-in.html [
Your best bet is to create your own sitemap provider. There is an sqlSiteMapProvider that can be used in this situation.

http://msdn.microsoft.com/en-us/magazine/cc163657.aspx[^]

In essence the link above is how to create a sitemap provider by inheriting the base sitemap provider (as you would anyway) to create an sql version. You should be able to get from this what you need to do.

You could also create a more basic version using :

Binding Menu Control With Database[^]
Populating Menu Control in ASP.NET 2.0 - using different data sources[^]
http://aspdotnetcodebook.blogspot.co.uk/2008/04/how-to-create-database-driven-menu-in.html[^]


这篇关于将菜单绑定到sql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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