All the samples for master pages I've seen reference master pages like this: ~/SiteTemplate.master
I'm not sure why anyone would actually utilize master pages in this fashion. Anyway, 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