   [.net] [ASP.NET] Referring to proper stylesheet location from masterpage
  I'm currently brushing up my ASPX skills a bit, and I was working with a bunch of test pages. While all of these pages work when in the root directory of the site, they don't show their stylesheet when placed in a sub-directory.This is actually quite logical as the CSS link is this:<link href="themes/default/msvs_template_simple_divs.css" rel="stylesheet" type="text/css" />The behaviour is perfectly normal, but I'm wondering how I can make the themes thing refer to ~/themes/etc. I tried adding ~/ in front of the themes and then add a runat="server" tag, but that didn't help much.Anyone has an idea on this?Toolmaker   
  did try using "../themes/default/etc..."?   ;  I believe you can place a call to ResolveUrl or something:<link href="<%ResolveURL()%>/default/msvs..."/>For one of my pages, I have added code to the header manually.HtmlGenericControl headerHTML = new HtmlGenericControl("link");headerHTML.Attributes["href"] = "http://focusedgames.com/rss.aspx?term=1";headerHTML.Attributes["title"] = "Focused Games - News";headerHTML.Attributes["type"] = "application/rss+xml";headerHTML.Attributes["rel"] = "alternate";Header.Controls.Add(headerHTML);;  You can start the href attribute with a forward slash (/) that would tell the browser to start at the root of the website and walk down the rest of the path to your css file.Second option you can use is to make the link tag a server side control (attribute runat="server") and then start it with a tilda and forward slash (~/) that tells the asp.net worker thread to translate it for you from the root of the site.Simplest method: <link href="/themes/default/msvs_tempplate_simple_divs.css" rel="stylesheet" type="text/css" />.  That isn't even ASP.NET that is html.  You can do that with images files, script files, css files and linked files with in your site.   