Solved

get browser type using ASP

Posted on 2009-06-27
3
388 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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

17 Experts available now in Live!

Get 1:1 Help Now