Detecting Browser

  • Thread starter Sergey Poberezovskiy
  • 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.
 
R

Rutger Smit

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
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top