Solved

Identify Browser type and version in ASP

Posted on 2013-05-28
10
888 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
 
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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 82

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 82

Expert Comment

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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

19 Experts available now in Live!

Get 1:1 Help Now