steve gray 8/6/2011 2:28:49 PM

Dynamic Style Sheet Links in ASP.NET

Earlier I discussed how to dynamically link to background images in ASP.NET. This is a little different, and repuires a little different techniqe. The issue is that when a master page serves a page in a subdirectory, it can't find the style sheet. Not a problem, really, except for the way that ASP.NET 2.0 development works. In development, the site runs as a virtual site, and the path to the css is different in development than when published.

This code will fix that.

Create the css links in the header section of the master page like this:
Version: Unknown or N/A
Section: Off Topic


Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3