Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6643209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:01:28+00:00 2026-05-26T00:01:28+00:00

I have a master page, and this master page has the following code <%@

  • 0

I have a master page, and this master page has the following code

<%@ Master Language="C#" AutoEventWireup="true" MasterPageFile="../sales/sales.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
   </asp:Content>

Now here is the issue i am having.. this is a copy of another master page within a site, but I have multiple sites that will be using it and I just want to make it common to all but I still want to access “..sales/sales.master” the problem is that this is within each site folder, for example

Web/
mySite1
   sales
     sales.master
mySite2
   sales
     sales.master

But now I need to have a master that will do the same for all

Web/
  All
    mynewmaster.master
  mySite1
     sales
        sales.master
  mySite2
     sales
        sales.master

so in mynewmaster.master I want to call MasterPageFile=”../sales/sales/master” but I can’t because 1) it would not find it and 2) it would not know which one to look at..

sales.master has all the css everything I need.. + other stuff I will add..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:01:30+00:00Added an answer on May 26, 2026 at 12:01 am

    I believe you can only change the master from OnPreInit:

    protected override void OnPreInit(EventArgs e)
    {
        base.OnPreInit(e);    
        Page.MasterPageFile = "MasterPage.master";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a master page in MVC that has the following code in
I have a master page in C#, where I have this code: <div style=width:
I have an ASP.net master page. In this master, I have all my css
I have a web site in asp.net that uses a master page. In this
I have this code, I added JS Script file to my Master page. <script
I have code like the following: <s:VGroup gap=10 id=group height=100%> <s:Label text=This is page
I have an aspx master/content page scenario. The parent page has an IFrame which
So I have a master page which has the following function '# Get and/or
I have a master page which has a content section with the id cpMainContent.
I have a master page called SampleMaster.master and this page contains a Repeater control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.