Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Now-a-days, indirectly, postal services have been replaced by email services. Yes, whenever we hear the word "email" a lot of people only think of gmail. Some people still think that email and gmail are one and the same thing :-). Let's see some …
Several part series to implement Internet Explorer 11 Enterprise Mode
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
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.

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now