views:

761

answers:

3

Just like the every other web developer, I'm frustrated to hack my site code to work with IE 6. So decided to give up support for IE 6 and ask them politely to upgrade to IE 7+ or Firefox.

Can you suggest me how to detect IE6 users and display a special page showing the upgrade details in ASP.NET MVC?

Is handling this at server side scripting a good idea? or do you recommend to use any client side script like jQuery to handle this?

+1  A: 

Showing a totally different page for IE 6 is a bit harsh IMHO, unless you want to block/redirect there is no need to validate this on the server-side.

Politely” would mean that you validate the browser on the client side and show an alert/remind message to upgrade. The folks at stoplivinginthepast.com have build a standard logic to do this based on conditional comments (they suggest you show a message on the top of your landing page).

http://www.stoplivinginthepast.com/get-the-code/

Image courtesy: http://www.stoplivinginthepast.com/

Cherian
@Cherian: *STOP LIVING IN THE PAST AND UPGRADE!* is "polite"? Also, suggesting people at work *talk to their IT department* is, quite frankly, silly. Large companies do not engage in a Citrix migration or web browser upgrade because some staff want to use a newer version of Internet Explorer. Using the argument that a newer version will make the company data more secure is unlikely to help in these instances because any large company will already have several layers of security in place and already know about any remaining security risks.
Grant Wagner
@Grant you are free to change the message. This is client side code with MIT license
Cherian
+2  A: 

It would be terrible practise to specifically serve a different non-functional page to IE6. For starters, if you're in the UK you're likely to run afoul of the DDA, for seconds (depending on your situation of course) you really don't want to just stop 20-25% of your users using your site.

A lot of people are forced into using IE6 at work. Pissing them off unneccesarily doesn't make good business sense.

That said, there's no reason to make your site look pixel-perfect. You can detect that they're using IE6 server-side with Request.UserAgent and display an unobtrusive message at the top of your home page (or at the top of every page) letting users know that their browser is very old and you don't support it anymore. Then you can either serve a specific IE6 stylesheet (very cut-down), or if IE6's rendering issues aren't so severe as to make your site unusable, you can just not bother about them.

When I'm doing internet-work these days I charge extra to support IE6.

Iain Galloway
+2  A: 

You may do the detection from the coding:

// ASP.net MVC C# example if (Request.Browser.Browser == "IE" && Request.Browser.Version.ConvertTo<float>() < 7.0) {   // output message to urge user to upgrade to latest IE browser }
exiang