来自数据库的子菜单的reterive valus [英] reterive valus for sub menu from database

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

问题描述

我使用锚标记手动创建了我的菜单链接,但我想在点击每个链接时显示数据库中的子菜单,我怎么能在asp

i had created my menu links manually using anchor tag,but i want to display submenus from database when clicking on each link, how i can i do that in asp

推荐答案

中执行此操作

感谢您的回答,让我尝试使用代码
thanks for your answer,Let me try with the code


ok.create一个递归方法,从数据库中获取数据并选择具有适当条件的主菜单。现在,使用链接的主菜单键/主菜单链接检查子菜单是否存在子菜单。如果子菜单存在,则再次调用方法和子菜单的相同条件。



您可以使用适当的css和html将这些值添加到字符串值中。 />
就像这个例子:



ok.create a recursive method which get data from database and select the main menu with appropriate condition. now, check the sub menu with your linked main menu key/main menu link that sub menu exist or not. If the sub menu exist then call the method again and same condition for sub menu.

You add those value with your appropriate css and html in a string value.
like this example:

string _menu= "<ul><li><a href=""+menu_link_from_db+"" target="_blank">"+menu_name_from_db+"</a></li></ul>";





因此,如果您完成调试递归方法,那么结果字符串将像下面的字符串一样增加。



启动你的代码,试一试。如果有任何问题,请敲我们。





谢谢。



Rashed ::孟加拉国。



so if you complete debug your recursive method then your result string will increase like following string.

start your code, try yourself. if any problem face then knock us.


Thank you.

Rashed::Bangladesh.


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

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