Root master page and chikd project

Discussion in 'ASP .Net Web Controls' started by Byka, Nov 8, 2007.

  1. Byka

    Byka Guest

    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
     
    Byka, Nov 8, 2007
    #1
    1. Advertising

  2. 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
     
    Mohamad Elarabi, Dec 19, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,255
  2. Doug McCann
    Replies:
    1
    Views:
    1,079
    William Brogden
    Aug 5, 2004
  3. Zeba
    Replies:
    1
    Views:
    522
    Mark Rae
    Feb 22, 2007
  4. Nathan Sokalski
    Replies:
    25
    Views:
    1,469
    Nathan Sokalski
    Mar 4, 2010
  5. SerpentKiss2010
    Replies:
    0
    Views:
    2,517
    SerpentKiss2010
    Apr 6, 2011
Loading...

Share This Page