Solved

Identify Browser type and version in ASP

Posted on 2013-05-28
10
947 Views
Last Modified: 2013-05-28
This reports IE 10 as IE 7
var bc = Server.CreateObject("MSWC.BrowserType");

Anyone have a way to detect IE 10 using ASP?

I'd rather not jump through the hoops to  try  cyScape.BrowserObj.  
Also unknown if that's going to work on Win 2008 server .

Thanks
0
Comment
Question by:awalkinthepark
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 39202566
I'm guessing ServerVariables doesn't work for you?
0
 
LVL 4

Expert Comment

by:baller119
ID: 39202584
Have you already tried parsing the Request.ServerVariables("HTTP_USER_AGENT") variable?
0
 

Author Comment

by:awalkinthepark
ID: 39202601
Right, when using  windows 7 and  IE 10
Request.ServerVariables("HTTP_USER_AGENT")  returns:

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 4

Expert Comment

by:baller119
ID: 39202609
Is compatibility mode enabled in IE10?
0
 

Author Comment

by:awalkinthepark
ID: 39202613
That's the point. I want to detect if it's IE 10 , and if so, put a message up to the users
to toggle compatibility mode.
0
 
LVL 4

Accepted Solution

by:
baller119 earned 500 total points
ID: 39202614
The portion of the string that indicates IE10 in your example is "Trident/6.0" - that is unique to IE10.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39202706
Here's a list of IE User Agent strings: http://www.useragentstring.com/pages/Internet%20Explorer/  I'm sure it's not complete but it's something to work with.
0
 

Author Closing Comment

by:awalkinthepark
ID: 39202836
Nice.
"Trident/6.0"  so  obvious!

Thanks.
And for anyone else needing it:

var str= new String(Request.ServerVariables("HTTP_USER_AGENT"));
var IE10Flag = str.indexOf("Trident/6.0");

Followed by :

if (IE10Flag>0) {
//do something
}
0
 

Author Comment

by:awalkinthepark
ID: 39202847
according to that link,
there are  IE 10  strings without Trident 6.0
but they have "MSIE 10.0"  so I guess check for either

Sorry closed  it before seeing that so can't give you points
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39202854
Everybody is telling me that today...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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
Get hold of longitude and latitude in iframe string 11 48
age from date of birth 4 51
IIS URL Rewrite/Redirect Rule Help 4 25
ASP exit 10 19
What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

861 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