Author: Joe Stagner | Posted on: 3/22/2010 2:46:00 PM | Views : 893

I had a cool question while I was at MIX.
A developer needed the ability to have his site render pages using a CSS file selected based on some user specific criteria.
ASP.NET 4 controls generate CSS friendly output and more and more we web developers are using CSS for layout etc.
Using multiple CSS files in our site wide templates we can not only provide different aesthetic experiences but we can charge the style based on the device type (Printer or Phone) or the special needs of the end user (Color Blind of Vision Impaired).
It’s really easy.
I set the Theme Directory yin the Session Start Event Handler.
Though I’, simply setting to a static value here, this is were you would make some decisions in code. You could check for a cookie or the device type.
If you want to make the CSS user selectable you might use a default CSS file until the user logs in and then set this Session Object in the Log In event handler ...

Go to the complete details ...