link tags (stylesheet includes) allow ASP.Net paths (~/) only on top-level pages - by Chris Moschini

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 342116 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 5/6/2008 7:35:01 AM
Access Restriction Public
Primary Feedback Item 317251


~/ style paths only work in specific scenarios:

Master page
<!-- works - path parsed -->
<link href="~/sheet1.css" rel="stylesheet"/>

Inner master page
<!-- fails - sent to client with ~/ in path -->
<link href="~/sheet2.css" rel="stylesheet"/>

Content page
<!-- fails - sent to client with ~/ in path -->
<link href="~/sheet3.css" rel="stylesheet"/>
Sign in to post a comment.
Posted by Microsoft on 5/12/2008 at 8:10 AM
Hi SoopahMan -

Thank you for reporting this issue and detailing the steps. We are researching the problem and plan on providing a fix in the next release of the software.

The Web Tools Team
Posted by Chris Moschini on 5/8/2008 at 1:00 PM
I've attached a zip file as a TestCase. Unzip and run to see the bug in action.
Posted by Microsoft on 5/6/2008 at 7:11 PM
Thanks for reporting the issue.
In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided. We tried to repro with the following steps:

1. Create a new website.
2. Add a Master Page
3. Add two style sheet.(master.css and home.css)
4. Drag and drop master.css to the Master Page
<head runat="server">
<link href="master.css" rel="stylesheet" />
<asp:ContentPlaceHolder ID="head_Content" runat="server" />
[kylin]we can see that there is a mistake here.
it should not be:
<link href="~/master.css" rel="stylesheet" />
5. Add a Web Page using the Master Page.
6. Drag and drop home.css to the head content of the Web Page.
<asp:Content ContentPlaceHolder="head_Content" runat="server">
<link href="home.css" rel="stylesheet" />
[kylin]same mistake as step4
7. View the page and we find home.css apply

It may help if you provide us with:

1. a zipped web site.
2. more snapshots.

If we do not receive a response from you after 7-days , we will automatically close your issue. There is no obligation to respond -- at any time you may edit your issue via Connect and change the status to “Active.”

Thank you,
Visual Studio Product Team