Click here to Skip to main content
14,429,185 members
Rate this:
Please Sign up or sign in to vote.
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
Rate this:
Please Sign up or sign in to vote.

Solution 2

thanks for your answer,Let me try with the code
   
Rate this:
Please Sign up or sign in to vote.

Solution 1

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>";


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.
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100