Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting browser type in ASP
Message
From
03/01/2002 12:01:40
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00600308
Message ID:
00600344
Views:
14
>>I never had to do it before. So far, I was always using it from Javascript. I was wondering what the equivalent would do to detect the browser from ASP?
>
>Michel;
>
>Here is a good starting point. This checks to be sure version 5.0 of I.E. is being used.
>
>
>< %
>' Check Browser version...
>
>response.buffer = true
>
>
>Dim strUserAgent
>Dim llOK
>strUserAgent = Request.ServerVariables("HTTP_USER_AGENT")
>if inStr(strUserAgent, "MSIE 5.0") <> 0  then
>'	Response.Write "Correct Browser is being used"
>Else
>Response.Redirect " BrowserNotification.asp "
>End If	
>% >
>
Thanks, this is what I implemented a few minutes ago.

I found various objects that does the job. However, some of them return Netscape as the browser type and this is not correct. Then, I started to look at some function and found the InStr(). So, I mainly used the same approach.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform