Detecting Downlevel Browsers

J

Jeremy S.

In an ASP.NET 1.1 Web application, how can I detect - with *reasonable*
accuracy - whether any particular browser is a downlevel browser?

My objective is to insert a different menu (different User Control
containing a different menu) for downlevel vs uplevel browsers.

This is very important as I have a great DHTML menu - but on many MACs, it
doesn't work even though the vendor claims to cater to downlevel browsers.
So I'm going to generate my own menu for the downlevel browsers and need a
way to determine when to send down the simpler (downlevel) menu vs the super
duper DHTML menu.

Please note that I'm already aware that some geeks out there can force their
old or non mainstream browsers to pretend they're IE (via header mods): but
I'm not at all concerned about them. I'm more concerned about old grandmas
with old computers running old browsers (or running iMacs).

Thanks!
 
J

Juan T. Llibre

Hi, Jeremy.

For helpful info on which features downlevel and uplevel browsers support, see :
http://msdn2.microsoft.com/en-us/library/x3k2ssx2.aspx

As far as detection itself, it's quite simple.

The class System.Web.HttpBrowserCapabilities has a long list
of capabilities you can check for. See the complete list at :

http://www.asp.net/QUICKSTART/util/...pace=System.Web&class=HttpBrowserCapabilities

Select the capabilities you want to test for with Request.Browser

If you want to filter on whether the browser supports CSS, you'd use :

Request.Browser.SupportsCss

i.e.,

If Request.Browser.SupportsCss
'include a CSS style
else
'redirect or do something else
End If

For what you want to do you need to check these capabilities :

1. Whether the requesting browser's MSDomVersion property is version 4.0 or higher.
2. Whether the requesting browser's EcmaScriptVersion property is version 1.2 or higher.

If they both are, you can send them the super duper DHTML menu.
If they are not, you should send them the simpler menu, using only HMTL 3.2.

See a running browser detect sample at : http://asp.net.do/test/browserDetect.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top