Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Detecting Downlevel Browsers

Reply
Thread Tools

Detecting Downlevel Browsers

 
 
Jeremy S.
Guest
Posts: n/a
 
      05-18-2006
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!


 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      05-18-2006
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/c...erCapabilities

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




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
"Jeremy S." <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
> 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!
>





 
Reply With Quote
 
 
 
 
Jeremy S.
Guest
Posts: n/a
 
      05-19-2006
Thank you so much Juan! Incredibly helpful response, as usual.

-J


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX and Downlevel Browser Support Robert Howells ASP .Net 4 10-24-2007 03:01 PM
Browsers, browsers! Quo vadis? El Kabong HTML 23 05-13-2007 08:55 PM
Two Browsers work! Two browsers won't load. Internet game service won't load jimmie Computer Support 1 02-26-2006 08:36 AM
Detecting Script enabled or not in Client Browsers =?Utf-8?B?U2FtYmE=?= ASP .Net 4 07-29-2005 10:22 AM
Detecting Browsers in Python Daniel Orner Python 4 11-18-2003 05:03 PM



Advertisments