?
Solved

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

Posted on 2008-10-15
3
Medium Priority
?
1,188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
GeoffSutton earned 2000 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

TCP/IP Network Protocol Cheat Sheet

TCP/IP is a set of network protocols which is best known for connecting the machines that make up the Internet. The truth is that TCP/IP is one of the oldest network protocols and its survival is mainly based on its simplicity and universality.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

765 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