.NET - Written by typemismatch on Monday, October 29, 2007 22:44 - 0 Comments

VS 2005 Style Sheet Tip

Tags: ,

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

  • Digg
  • del.icio.us
  • Facebook
  • Technorati
  • StumbleUpon


Leave a Reply

Comment

Most Popular Content

Electronics, iPhone - Aug 3, 2008 12:14 - 0 Comments

iPhone Battery Tip

More In Electronics


MultiCore - Jul 30, 2008 22:38 - 0 Comments

Here comes MultiCore

More In MultiCore


Software - Oct 20, 2008 21:04 - 0 Comments

Silverlight Tip - Initialize!

More In Software