Solved

get browser type using ASP

Posted on 2009-06-27
3
390 Views
Last Modified: 2012-05-07
I have the following code in my page to find out the browser type. I am using Internet Explorer 7. But how comes the result returning the Browser is Netscape...?

the result which I got is

output:
Browser: Netscape
Version: 4.00
Majorver: 4
Minorver: 00
Platform: unknown
Supports frames: True
Supports tables: True
Supports cookies: True
Supports JavaScript: True

thanks
<%

' create an instance of the Browser Capabilities component

Set browserdetect = Server.CreateObject("MSWC.BrowserType")
 

browser=browserdetect.Browser

version=browserdetect.Version

majorver=browserdetect.Majorver

minorver=browserdetect.Minorver

platform=browserdetect.Platform

frames=browserdetect.Frames

tables=browserdetect.Tables

cookies=browserdetect.Cookies

javascript=browserdetect.JavaScript
 
 

' send some output to the web browser

response.write ("Browser: " & browser & "<BR>")

response.write ("Version: " & version & "<BR>")

response.write ("Majorver: " & majorver & "<BR>")

response.write ("Minorver: " & minorver & "<BR>")

response.write ("Platform: " & platform & "<BR>")

response.write ("Supports frames: " & frames & "<BR>")

response.write ("Supports tables: " & tables & "<BR>")

response.write ("Supports cookies: " & cookies & "<BR>")

response.write ("Supports JavaScript: " & javascript & "<BR>")

%>

Open in new window

0
Comment
Question by:siva_gk
  • 2
3 Comments
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 24730094
>how comes the result returning the Browser is Netscape...?

Probably because you are using no or an old Browsercap.ini file which does not have the correct information.

http://support.microsoft.com/kb/311227
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 24730145
0
 

Accepted Solution

by:
siva_gk earned 0 total points
ID: 24761659
var agent= navigator.userAgent.toLowerCase();
var ie = agent.indexOf("msie")>=0;
if (ie){
} else {
alert('Other than IE Not Supported');
//redirect to warning page
}


this is what I want...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 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

16 Experts available now in Live!

Get 1:1 Help Now