Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

thanks for your answer,Let me try with the code
 
Share this answer
 
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:

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


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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900