Master pages, how do you reference when outside of application?

J

John Holmes

I have a website that consists of numerous ASP.NET applications (each
referred to as a website in VS 2005) which I'd like to have share a master
page. My directory structure on the website is like this:
/Apps/App1, /Apps/App2, /Apps/Common, /Apps/App3, ...

So the path to any one of these apps can be referred to as
/Apps/App1/default.aspx and depending on if it's on our public site, dev
site, test site, or intranet site the correct URL will be formed .. ie,
http://myTestDomain.com/Apps/App1/default.aspx.

I would like to locate my master page in the /Apps/Common/MasterPages
directory and was thinking I'd reference it like:
MasterPageFile="/Apps/Common/MasterPages/MasterPage.master" but that doesn't
work. I've tried using "../Common/MasterPages/MasterPage.master" and there's
a problem with that. I'd like to get some help on understanding the correct
way to reference the path to the master page file when it is outside the
current application.

So, my Page directive for /Apps/App1/default.aspx looks like this but it
doesn't work.

<%@ Page Language="C#"
MasterPageFile="/Apps/Common/MasterPages/MasterPage.master"
AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

Thanks for any help ... john
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top