473,287 Members | 1,714 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,287 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 1896
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
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...

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.