Posts Tagged ‘CSS’
.NET - Monday, October 29, 2007 22:44 - 0 Comments
VS 2005 Style Sheet Tip
Some of you may already know this little asp.net secret but if you don’t enjoy :)
It appears that when an asp.net page renders due to the fact that the header element is actually being generated on the server before it is sent to the client some nifty things happen. I hope you already know that any style sheets placed in a theme folder will get added to the header automatically. This is really great but what if you want a style to be conditional?
Well, normally you’d put the css into another folder so it isn’t automatically added - for example you might use /css/ie_hacks.css or something like that. In the header you’d probably specify the css source as /css/ie_hacks.css but you can take a short cut. You can just use the style sheet name, ie_hacks.css and when the page is rendered the full path will be found.
I use this a lot with conditional IE hacks where I want a path rendered that I do not know during development since many of my site projects run mutiple clients under one site.
-c