473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Detecting Browser

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.
Nov 18 '05 #1
2 1513
Sergey Poberezovskiy wrote:
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
Nov 18 '05 #2
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)
"Sergey Poberezovskiy" <an*******@discussions.microsoft.com> wrote in
message news:26****************************@phx.gbl...
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.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Frances Del Rio | last post by:
pls, why is this not working? <SCRIPT language=JavaScript type="text/javascript"> var br = '<SCRIPT language=Javascript' br += 'src="js_pop.js" type="text/javascript">' br += '</SCRIPT>' var...
25
by: Ryan Stewart | last post by:
I'm working on a project to collect web application usage statistics. What are the recommended ways of detecting whether a browser is JavaScript enabled and/or capable? Obviously I can write a...
3
by: raptor | last post by:
hi, how to detect opera..it seems that even opera8 doesnt support xmlhttp fully (.i.e. sendRequestHeader). I ask this 'cause opera seems to mimic IE, at least in the preferences ?! I havent...
1
by: Sharkbait | last post by:
We are trying to record browser information when a customer comes to our site. I have been able to get most basic browser information using both asp and asp.net. The only thing I’m missing is the...
2
by: Sam-Kiwi | last post by:
I've spent the last 6 months developing a pay-per-download website using ASP.NET Users purchase documents and then download them. The intention is that users are only charged for documents...
3
by: regtrashcan | last post by:
I have a webpage that detects whether Shockwave Player is installed and the version number. The javascript/vbscript that I use has worked fine until the latest release of the Shockwave Player. I am...
79
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the...
1
by: Mango | last post by:
I'm trying to print some text in a very specific position on a page, so that it will show through the window of an envelope when folded. This is easy to do, as long as the browser's print margins...
1
by: Grzegorz Klimsa | last post by:
Hi ! I have a problem wiht detecting resolution of client web browser I prepare several files of css style for different browsers and different resolutions, (such as : Style_1024x768.css ;...
15
by: RobG | last post by:
When using createEvent, an eventType parameter must be provided as an argument. This can be one of those specified in DOM 2 or 3 Events, or it might be a proprietary eventType. My problem is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.