Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please Explain how to load a master page Dynamically from database like Page content.
Posted

Hi ,
Check this
First Bring your master page path from DATABASE
then on OnPreInit Write your code .
C#
protected override void OnPreInit(EventArgs e)
{
    base.OnPreInit(e);
    Page.MasterPageFile = "~/MasterPage.master"; // retrieved From DataBase
}


Best Regards
M.Mitwalli
 
Share this answer
 
v3
Comments
Pankaj Nikam 19-Jun-12 7:45am    
Bingo! +5 :)
Mohamed Mitwalli 19-Jun-12 8:05am    
Thanks Pankaj
Do u want the menu items to come up from DB?

Then use dataset or list.
 
Share this answer
 
Comments
dirrikichi 19-Jun-12 6:26am    
No masterpage is is containing some user controls which contain static data. i want these user controls in master page page to load dfron database.

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