Masterpage Path problem with Stylesheets
Posted on 2006-06-04
My question is related to a previous question which is found at:
Topics > Programming Languages > .NET > ASP.NET > Q_21334823.html
I am trying to use Masterpages on my site, where my Masterpage and my Stylesheet are in the root directory, and the pages calling it (ex: default.aspx) are in subdirectories. Here's my setup:
- Pictures (directory)
The previous question asked how to get image-related URLs to point correctly when the calling page was not in the same directory as the Masterpage. However, this solution (ie: none of the solutions posted in this question) work for setting the relative path for the stylesheet.
I have the following code in my Masterpage, and a css file MyStyles in the root directory:
<link rel="stylesheet" type="text/css" href="MyStyles.css">
However, when I run upload1.aspx (which uses the Masterpage), it will not find the Stylesheet.
I have tried "~/Mystyles", "..\Mystyles", "..Mystyles" etc... to no avail.
I have also tried to add:
Dim Mylink As HtmlLink
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Mylink.Href = "MyStyles.css"
but still with no success.
Any ideas ?