Detecting Browser details

Discussion in 'ASP .Net' started by Iain, Aug 3, 2007.

  1. Iain

    Iain Guest

    Hi All

    Hope someone can help.

    Using Delphi Borland Developer 2006, a C# Internet project.

    I am attempting to detect the Browserm version etc during the Page
    Load event but cannot work out how.

    Basicall I want to get the following type (see the script at the
    bottom of the post ) of information and store the information in a
    session variable then save to a database table if required. Is this
    possible, and if so how.

    Many thanks in advance for any help offered

    Iain

    <script type="text/javascript">
    var x = navigator
    document.write("CodeName=" + x.appCodeName)
    document.write("<br />")
    document.write("MinorVersion=" + x.appMinorVersion)
    document.write("<br />")
    document.write("Name=" + x.appName)
    document.write("<br />")
    document.write("Version=" + x.appVersion)
    document.write("<br />")
    document.write("CookieEnabled=" + x.cookieEnabled)
    document.write("<br />")
    document.write("CPUClass=" + x.cpuClass)
    document.write("<br />")
    document.write("OnLine=" + x.onLine)
    document.write("<br />")
    document.write("Platform=" + x.platform)
    document.write("<br />")
    document.write("UA=" + x.userAgent)
    document.write("<br />")
    document.write("BrowserLanguage=" + x.browserLanguage)
    document.write("<br />")
    document.write("SystemLanguage=" + x.systemLanguage)
    document.write("<br />")
    document.write("UserLanguage=" + x.userLanguage)
    </script>
     
    Iain, Aug 3, 2007
    #1
    1. Advertising

  2. "Iain" <> wrote in message
    news:...

    > Load event but cannot work out how.
    >
    > Basicall I want to get the following type (see the script at the
    > bottom of the post ) of information and store the information in a
    > session variable then save to a database table if required. Is this
    > possible, and if so how.


    Some of the information is available through
    HttpContext.Current.Request.Browser, but most isn't...

    Easiest way I can think of doing this is to have an initial page (e.g.
    <root>/default.aspx) with a piece of JavaScript similar to what you already
    have, but which builds up a string of name/value pairs e.g.

    <script type="text/javascript">
    var x = navigator;
    var navProperties;
    navProperties += "appCodeName" + "¬" + x.appCodeName + "|";
    navProperties += "appMinorVersion" + "¬" + x.appMinorVersion + "|";
    etc...

    This is then stored in a hidden field and posted to your welcome page. In
    the code behind your welcome page, you would parse and split the string.


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
     
    Mark Rae [MVP], Aug 3, 2007
    #2
    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. Sergey Poberezovskiy

    Detecting Browser

    Sergey Poberezovskiy, Sep 15, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    367
    bruce barker
    Sep 15, 2004
  2. =B=
    Replies:
    3
    Views:
    3,854
  3. Prasad Dannani

    Getting Browser Details.

    Prasad Dannani, Sep 26, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    359
    Bruce Barker
    Sep 26, 2005
  4. =?Utf-8?B?Sm9l?=

    Show Details/Hide Details link button

    =?Utf-8?B?Sm9l?=, Mar 13, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    916
    dkode
    Mar 13, 2006
  5. Mortisus
    Replies:
    2
    Views:
    219
    Mortisus
    Mar 29, 2005
Loading...

Share This Page