Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

16 Experts available now in Live!

Get 1:1 Help Now