Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting Internet Explorer and Netscape

Status
Not open for further replies.

Jayson

Programmer
Jan 31, 2001
75
US
Is there a way to code in ASP to detect whether the user is using internet explorer or netscape?

Thanks!
 
Yes. You can use Request.ServerVariables collection to get the browser type:

browserType = Request.ServerVariables("HTTP_USER_AGENT")

You can also use:

browserType = Server.CreateObject("MSWC.BrowserType");
browser = browserType.browser;
version = browserType.version;
majorver = browserType.majorver;
minorver = browserType.minorver;
vbscript = browserType.vbscript;
etc...

You have to modify this stuff a little bit if you are using VBScript (no semicolons).
Hope the answer is helpful
Dmitriy
dbrom@crosswinds.net
 
Thanks i really appreciate it!

I guess what i'm trying to do is include a certain ASP file if its a netscape browser, and use another ASP file if its internet explorer browser. Is it possible to squeeze
<!-- #include whateverfile.asp --> inside an IF statement?

Thanks for your patients!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top