Click here to Skip to main content
15,911,890 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I have the menu in my application which retrieves the menu names from the database
when I run the application.
But I want to display the same menu names dynamically(before running the application).

I should not hardcode the names in menu items.. Instead, they should be displayed from the database table.

The following is the html for menu:

XML
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" Target="_self" MaximumDynamicDisplayLevels="1">
                       <items>
          <asp:menuitem >
            </asp:menuitem>
              


        </items>
                <StaticMenuItemStyle CssClass="CCL_innerpage_menu" />
        <DynamicMenuItemStyle CssClass="CCL_innerpage_menu" />
            </asp:Menu>



Can any one Please give me an idea.

Thanks in Advance.

Regards,
Raj
Posted
Updated 19-May-11 20:28pm
v2

sorry, but i am not getting your question.
do you want to load the data in your and asp.net menu control from database ?

see this its quite straight forward:
http://aspalliance.com/822_Building_a_Database_Driven_Hierarchical_Menu_using_ASPNET_20

or do you have any other requirements ?
 
Share this answer
 
v2
Comments
Raj.rcr 20-May-11 3:42am    
Hi, the link u have given is really very useful.. I have gone through that.. My problem is, I am getting the menu names from data base in the menu bar only when I run the appication.. But, I want the menu names to be displayed dynamically (on the page before running the application).

Hope u have understood what I am trying to say..
Raj.rcr 20-May-11 3:44am    
dynamically it displays as below:
Root Root Root Root Root Root.....

But I want like this:
Home UserMaintainance MyReport DailyReport Contact About
saxenaabhi6 20-May-11 5:14am    
of course the menu will load the values when you access the page in browser which is called dynamic behaviour.

you mean you want to see the menu from database when you developing your application, example you want to see them while you working in visual studio ? if so i dont think that is possible.

when you say 'On the page before running applicatin' what does this line mean ? you run the page in browser mean your application is running...
Raj.rcr 20-May-11 5:26am    
"you mean you want to see the menu from database when you developing your application, example you want to see them while you working in visual studio ? if so i dont think that is possible."

It sounds like u r right... Its not possible. But I am given the task to use XML and display the menu names which are in database.. and I should not hardcode the items in html tags. Do u think its possible?
saxenaabhi6 20-May-11 5:53am    
the task u have been given sounds right to me, but uare takin it in wrong way, u just have to read xml document and have to bind the asp.net menu control to it.. thats it.

you will not see the menu items while you developing your code but u will only see them once you run your application.
 
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