HighTechTalks DotNet Forums  

Root master page and chikd project

ASP.net Web Controls microsoft.public.dotnet.framework.aspnet.webcontrols


Discuss Root master page and chikd project in the ASP.net Web Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Byka
 
Posts: n/a

Default Root master page and chikd project - 11-08-2007 , 07:43 AM






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

Reply With Quote
  #2  
Old   
Mohamad Elarabi
 
Posts: n/a

Default RE: Root master page and chikd project - 12-19-2007 , 12:37 AM






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:

Quote:
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

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.