Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-07-06
6
Medium Priority
?
1,262 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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.
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 is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

963 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