ASP.NET 2.0 Master Pages - Referencing style sheets
Here’s one of those things I’m always forgetting, and since most of my work is on-site at clients, I don’t have a large source code repository to go back to reference.
To correctly reference a style sheet from within a master page in ASP.NET, use the following:
<link rel="stylesheet" href="<%= ResolveUrl("~/css/screen.css") %>" type="text/css" media="screen, projection" />
It’s the ResolveUrl that does the trick.
One Comment
- The Dan said: