Solved

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

Posted on 2008-10-15
3
1,184 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

749 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