![]() |
Root master page and chikd project
have a master page on my root project.
I would like to reuse the same master page on my child project. However when I am setting the master page file in my child project it doesn't see that page because it is adding a name space from my child project. Below is what I have: RootProject /UserControls RootMasterPage.Master /ChildProject childProjectWebPage.aspx with page directive to MasterPageFile="~/UserControls/RootMasterPage.Master" When I run my project it is looking for childProjectWebPage/UserControls/RootMasterPage.Master and it can find that master page. Can you help me |
RE: Root master page and chikd project
Is ChildProject an actual VS Project? or is it just a folder under the
RootProject? The ~ actually reverts back to the application root. If you set up ChildProject as a separate Project it will behave as a separate Application no matter what folder you place it into, and no matter what solution you place it into. If that is the case you can try using relative paths to reference the masterpage file in this case that would be MasterPageFile="../UserControls/RootMasterPage.Master" See if that works for you. What I do in similar Scenarios is I usually have one Project, and on the root folder I place a Root.Master and if I have subsites or mini apps under that application they would be in their own folder. In each subsite folder I'll have a subsite masterpage for example subsite1.master which inherits from the root.master. This gives you the flexibility of configuring your entire site to inherit the basic look from the main root.master but through the subsite.master files and in the same time you can use the subsite master files to make every subsite look different. Hope that helps. -- Mohamad Elarabi Lead Developer. MCTS, MCPD. "Byka" wrote: > have a master page on my root project. > I would like to reuse the same master page on my child project. However when > I am setting the master page file in my child project it doesn't see that > page because it is adding a name space from my child project. > Below is what I have: > RootProject > /UserControls > RootMasterPage.Master > /ChildProject > childProjectWebPage.aspx with page directive to > MasterPageFile="~/UserControls/RootMasterPage.Master" > When I run my project it is looking for > childProjectWebPage/UserControls/RootMasterPage.Master and it can find that > master page. > Can you help me |
| All times are GMT. The time now is 04:11 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.