Link to home
Start Free TrialLog in
Avatar of awalkinthepark
awalkinthepark

asked on

Identify Browser type and version in ASP

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
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

I'm guessing ServerVariables doesn't work for you?
Have you already tried parsing the Request.ServerVariables("HTTP_USER_AGENT") variable?
Avatar of awalkinthepark
awalkinthepark

ASKER

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)
Is compatibility mode enabled in IE10?
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.
ASKER CERTIFIED SOLUTION
Avatar of baller119
baller119
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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
}
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
Everybody is telling me that today...