Solved

Identify Browser type and version in ASP

Posted on 2013-05-28
10
924 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 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