Solved

Problem: IE8 browser detected as IE7 browser in ASP.NET application

Posted on 2009-07-06
6
1,255 Views
Last Modified: 2013-12-08
Hi guys.
I have strange problem.
I am trying to detect the user-browser in an ASP.NET application (in server side), below is the code
I tried.
The problem is that for IE8 I am getting that:
TYPE = IE7
Version = 0.
Does anyone understand what is going on?
I need to detect IE8 in server side, any suggestion?
Thanks,
Hagai

protected void Page_Load(object sender, EventArgs e)
    {
        System.Web.HttpBrowserCapabilities browser = Request.Browser;
        string s = "Browser Capabilities\n\n"
            + "Type = " + browser.Type + "\n\n"
            + "Name = " + browser.Browser + "\n\n"
            + "Version = " + browser.Version + "\n\n"
            + "Major Version = " + browser.MajorVersion + "\n\n"
            + "Minor Version = " + browser.MinorVersion + "\n"
            + "Platform = " + browser.Platform + "\n"
            + "Is Beta = " + browser.Beta + "\n"
            + "Is Crawler = " + browser.Crawler + "\n"
            + "Is AOL = " + browser.AOL + "\n"
            + "Is Win16 = " + browser.Win16 + "\n"
            + "Is Win32 = " + browser.Win32 + "\n"
            + "Supports Frames = " + browser.Frames + "\n"
            + "Supports Tables = " + browser.Tables + "\n"
            + "Supports Cookies = " + browser.Cookies + "\n"
            + "Supports VBScript = " + browser.VBScript + "\n"
            + "Supports JavaScript = " +
                browser.EcmaScriptVersion.ToString() + "\n"
            + "Supports Java Applets = " + browser.JavaApplets + "\n"
            + "Supports ActiveX Controls = " + browser.ActiveXControls
                  + "\n";
 
        Response.Write(s);
    }

Open in new window

0
Comment
Question by:netformx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 5

Expert Comment

by:iUsername
ID: 24783528
May the problem is in your browser's user-agent.
0
 

Author Comment

by:netformx
ID: 24783647
What does it mean?
How can I know that?
0
 

Author Comment

by:netformx
ID: 24783732
OK, I found how to detect that browser is IE8:
for IE8, the user agent contains the word "Trident"

:-)
0
 
LVL 5

Expert Comment

by:iUsername
ID: 24783906
Glad it works! :-)
0
 

Accepted Solution

by:
ee_auto earned 0 total points
ID: 25040689
Question PAQ'd, 500 points refunded, and stored in the solution database.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mozilla Favorites 10 47
Prevent surfing 14 56
How to build a web site 17 102
Starting to use Git with Visual  Studio Online 1 70
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question