Click here to Skip to main content
15,901,283 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI,

I am loading some user controls dynamically on master page. My user controls are for displaying the menu. I am loading the menu item from DB.

for adding the menu items from db i have a written a code on code behind of user control.

the problem is when I am trying to load that menu control dynamically (by clicking on a button) its loading but after the content page(bottom of master page).

Can some one help me out from this please.
Posted
Comments
Mahesh Bailwal 17-Jun-13 5:19am    
Can you share code where you are adding control dynamically.
Member 8393534 17-Jun-13 5:25am    
Control c = Page.LoadControl("~/Controls/JRPortering.ascx");
masterMenu.Controls.Add(c);

Please add PlaceHoder control in your master page at design time (not at run time) where you want to display menu. Then at run time add menu control in this placeholder dynamically.

Please try this and let me know if it works.
 
Share this answer
 
Comments
_Amy 17-Jun-13 5:51am    
+5!
Mahesh Bailwal 17-Jun-13 5:57am    
Thanks :)
Hi its resolved by adding the menu control directly on master page. what i did is that I wrote a code to get the menu items from DB and added them to a RadMenu (Telerik) control and then added that RadMenu control to placeholder.

Thanks
 
Share this answer
 
Comments
_Amy 17-Jun-13 5:50am    
It's not an answer. Please use comment box to write comments/queries.

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