473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Detecting Downlevel Browsers

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!
May 18 '06 #1
2 1898
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." <A@B.COM> wrote in message news:%2***************@TK2MSFTNGP05.phx.gbl...
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!



May 18 '06 #2
Thank you so much Juan! Incredibly helpful response, as usual.

-J
May 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Frances Del Rio | last post by:
pls, why is this not working? <SCRIPT language=JavaScript type="text/javascript"> var br = '<SCRIPT language=Javascript' br += 'src="js_pop.js" type="text/javascript">' br += '</SCRIPT>' var...
20
by: Mandy Memphis | last post by:
If I perform a mousedown within a document, move the mouse outside the browser window, and then release the mouse button, the document.onmouseup event does not fire. Is there any way to detect a...
25
by: Ryan Stewart | last post by:
I'm working on a project to collect web application usage statistics. What are the recommended ways of detecting whether a browser is JavaScript enabled and/or capable? Obviously I can write a...
13
by: ima | last post by:
I've been studying a great book on css and now that I've put together a few pages using it, I'm finding out that my book needed one more very important chapter. Introducing css in the real world. ...
79
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the...
7
by: Nathan Sokalski | last post by:
I want to make sure I am doing a browser detection that will work once IE7 is released. My current detection statement (written using VB.NET) is: If Me.Request.Browser.Browser.ToUpper() = "IE"...
4
by: Arek | last post by:
Hi, How to detect Windows version and .NET version? I mean I want to know if user is using Windows 2000, XP, Vista and which Service Pack and version (XP Home, XP Pro, Vista Home Basic, Vista...
1
by: Grzegorz Klimsa | last post by:
Hi ! I have a problem wiht detecting resolution of client web browser I prepare several files of css style for different browsers and different resolutions, (such as : Style_1024x768.css ;...
15
by: RobG | last post by:
When using createEvent, an eventType parameter must be provided as an argument. This can be one of those specified in DOM 2 or 3 Events, or it might be a proprietary eventType. My problem is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.