Solved

browser detect then change css file if in ie6 or below .net

Posted on 2008-10-15
3
1,177 Views
Last Modified: 2012-05-05
Hi guys, i currently have a css file, which is referenced from my config file, this works fine in firefox 2 and 3, google chrome, opera, safari and ie7, however when i view it in ie6 it looks awful, so i have set up a theme for ie6. Now what i need to do is have some piece of code that changes the line of code in the config file to the theme for ie6 if the users browser is ie6 or below, this bit of code can go into my masterpage file of course, does anyone have an idea of how to do this in .net, im programming in c#

Thanks
0
Comment
Question by:Ianaldo
3 Comments
 
LVL 10

Accepted Solution

by:
GeoffSutton earned 500 total points
ID: 22750461
Hi Ianaldo.

Take a look at http://forums.asp.net/t/1024266.aspx - it has basically the same problem you would like to take care of.

As for browser detection, see http://nlakkakula.wordpress.com/2008/09/11/browser-detection-in-code-behind-aspnet/

This is really a simple means.  Also you can do much the same thing from clientside, and add a new stylesheet element to the DOM, and set the source via Ajax, but I don't have specific information on hand on how to take that approach.

I hope this helps,

Geoff
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now