I have a master page (mast.master) and a nested master page (nested.master) in the root. I also have two stylesheets in the root (Master.css) and (Master3Col.css).


In the head of mast.master I link its stylesheet as follows:

<head runat="server">
<title>History Repeats</title>
<link href="Master.css" rel="stylesheet" type="text/css" media="screen" runat="server" />
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>

In nested.master, within the place holder for the head, I link to a stylesheet that pertains only to content pages using the nested master page, as follows:

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<link href="Master3Col.css" rel="stylesheet" type="text/css" media="screen" runat="server" />
<asp:ContentPlaceHolder ID="head3col" runat="server">
</asp:ContentPlaceHolder>
</asp:Content>

NOW FOR THE CONTENT PAGES...

I have Welcome.aspx (in the root) and both stylesheets are recognized and rendered to the browser as follows:

<link href="Master.css" rel="stylesheet" type="text/css" media="screen" />
<link href="Master3Col.css" rel="stylesheet" type="text/css" media="screen"></link>

And the page looks great (well, at least correct).

Then I have a second content page "member/CurrentView.aspx" which is in a folder off the root.

The page is rendered to the browser as follows:

<link href="../Master.css" rel="stylesheet" type="text/css" media="screen" />
<link href="Master3Col.css" rel="stylesheet" type="text/css" media="screen"></link>

The result is that all content styled by Master.css works OK, but any content styled by Master3Col.css only works if the content page is in the root.

So... I'm somewhat baffled.

Here's what I've tried in the link tags of the masters, all without success:

1) Because I used runat-server in the link tags I tried "~/Master.css" and "~/Master3Col.css" as the hrefs.

In that case, the html for the Welcome.aspx was rendered as:
<link href="Master.css" rel="stylesheet" type="text/css" media="screen" />
<link href="~/Master3Col.css" rel="stylesheet" type="text/css" media="screen"></link>

and the html for CurrentView.aspx as rendered as:
<link href="../Master.css" rel="stylesheet" type="text/css" media="screen" />
<link href="~/Master3Col.css" rel="stylesheet" type="text/css" media="screen"></link>

Clearly, there is an issue in ASP.NET with resolving the path when using a nested master page in a content page that's in a folder off the root.

2) I also tried other link tag variations:
"../Master.css" and "../Master3Col.css"
"/Master.css" and "/Master3Col.css"
And even tried with and without runat=server.

The results varied with each trial, but in no case were both content pages rendered correctly.

So... any suggestions on how I might deal with this?

Thanks! Steve