Solved

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

Posted on 2009-07-06
6
1,256 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
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 +…

627 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