Detecting Downlevel Browsers

Discussion in 'ASP .Net' started by Jeremy S., May 18, 2006.

  1. Jeremy S.

    Jeremy S. Guest

    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!
    Jeremy S., May 18, 2006
    #1
    1. Advertising

  2. 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




    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." <> wrote in message news:%...
    > 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!
    >
    Juan T. Llibre, May 18, 2006
    #2
    1. Advertising

  3. Jeremy S.

    Jeremy S. Guest

    Thank you so much Juan! Incredibly helpful response, as usual.

    -J
    Jeremy S., May 19, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry Whitehouse
    Replies:
    3
    Views:
    437
    Harry Whitehouse
    Jul 22, 2003
  2. =?Utf-8?B?U2FtYmE=?=

    Detecting Script enabled or not in Client Browsers

    =?Utf-8?B?U2FtYmE=?=, Jul 29, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    347
    Rob Amos
    Jul 29, 2005
  3. Daniel Orner

    Detecting Browsers in Python

    Daniel Orner, Nov 18, 2003, in forum: Python
    Replies:
    4
    Views:
    795
    Dave Brueck
    Nov 18, 2003
  4. El Kabong

    Browsers, browsers! Quo vadis?

    El Kabong, May 11, 2007, in forum: HTML
    Replies:
    23
    Views:
    895
    dorayme
    May 13, 2007
  5. Robert Howells

    AJAX and Downlevel Browser Support

    Robert Howells, Oct 24, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    295
    Mark Rae [MVP]
    Oct 24, 2007
Loading...

Share This Page