Hi,
Recently I moved a website to a different machine for testing, and I
needed to replace the absolute site urls in my stylesheet links.
Instead of something like href="/blah/style.css" they were to say
something like href="<%# Settings.SiteRoot %>style.css". And the
relevant code:
public class Settings
{
public static string SiteRoot()
{
return Configuration.AppSettings["SiteRoot"];
}
}
This works on some pages, but not on others. Sometimes the <link> tag
contains the correct path ("/blah/style.css"), and other times (on the
same master page!) the href contains "style.css". No exceptions, no
compilation problems. Just on some pages the settings aren't read.
Now the interesting part is that all the images on the site use the
same mechanism to get the path, and they always work, on every page.
Whatever the cause for this bizarre behaviour, it is 1) consistent, and
2) affects only headers.
Any comments on this?
-Aleko