Solved

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

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Preface There are many applications where some computing systems need have their system clocks running synchronized within a small margin and eventually need to be in sync with the global time. There are different solutions for this, i.e. the W3…
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
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 +…

708 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

16 Experts available now in Live!

Get 1:1 Help Now