Detecting Browser

  • Thread starter Thread starter Sergey Poberezovskiy
  • Start date Start date
S

Sergey Poberezovskiy

Hi,

Simple question:

I developed an ASP.Net application that runs under IE. Now
for all other browsers I display a message that the
application runs under IE:

If Not
System.Web.HttpContextCurrent.Request.Browser.Type.ToUpper
().StartsWith("IE") Then
' log invalid browser error string
' Re-route to error page indicating the error
End If

The problem is when the requesting browser is behind a
proxy - I am receiving log entries that the browser type
is Netscape, even though the user is using IE.

Is there any reliable way to detect the browser type?

Thanks in advance.
 
Sergey said:
Hi,

Simple question:

I developed an ASP.Net application that runs under IE. Now
for all other browsers I display a message that the
application runs under IE:

If Not
System.Web.HttpContextCurrent.Request.Browser.Type.ToUpper
().StartsWith("IE") Then
' log invalid browser error string
' Re-route to error page indicating the error
End If

The problem is when the requesting browser is behind a
proxy - I am receiving log entries that the browser type
is Netscape, even though the user is using IE.

Is there any reliable way to detect the browser type?

Thanks in advance.

Maybe a doublecheck is an idea.
1: Check it with your asp.NET code
2: doublecheck it with JavaScript

--

//Rutger

DoDotNet@KICKTHIS_Gmail.com
www.RutgerSmit.com
 
there is no reliable way to detect the browser type from the server. the
best approach is to write a sniffer page that uses client script to do the
detection. this approach also allows detection that client script is
disabled. there are third party controls you can buy to do this.


-- bruce (sqlwork.com)
 
Back
Top