|
|
Home » ASP » Article
HTTP Browser Capabilities with ASP.NET
|
| Article by: | Robin Smith (6/25/2002) |
|
| Summary: | Use the httpbrowser object to read the capabilities of the user's browser |
|
| Viewed: 19229 times |
Rating (5 votes): |
|
3.4 out of 5 |
|
|
|
Using the httpbrowser object you can view the surfer's browser capabilities and respond accordingly.
<%@ Page Language="C#" %>
<html>
<body>
<table width="90%" border="0" align="center"
cellpadding="2" cellspacing="2">
<tr>
<td>Property</td>
<td>Value</td>
</tr>
<tr>
<td>ActiveXControls </td>
<td> <%= Request.Browser.ActiveXControls %></td>
</tr>
<tr>
<td>AOL </td>
<td> <%= Request.Browser.AOL %></td>
</tr>
<tr>
<td>BackgroundSounds </td>
<td> <%= Request.Browser.BackgroundSounds %></td>
</tr>
<tr>
<td>Beta </td>
<td> <%= Request.Browser.Beta %></td>
</tr>
<tr>
<td>Browser </td>
<td> <%= Request.Browser.Browser %></td>
</tr>
<tr>
<td>CDF </td>
<td> <%= Request.Browser.CDF %></td>
</tr>
<tr>
<td>ClrVersion </td>
<td> <%= Request.Browser.ClrVersion %></td>
</tr>
<tr>
<td>Cookies </td>
<td> <%= Request.Browser.Cookies %></td>
</tr>
<tr>
<td>Crawler </td>
<td> <%= Request.Browser.Crawler %></td>
</tr>
<tr>
<td>EcmaScriptVersion </td>
<td> <%= Request.Browser.EcmaScriptVersion %></td>
</tr>
<tr>
<td>Frames </td>
<td> <%= Request.Browser.Frames %></td>
</tr>
<tr>
<td>JavaApplets </td>
<td> <%= Request.Browser.JavaApplets %></td>
</tr>
<tr>
<td>JavaScript </td>
<td> <%= Request.Browser.JavaScript %></td>
</tr>
<tr>
<td>MajorVersion </td>
<td> <%= Request.Browser.MajorVersion %></td>
</tr>
<tr>
<td>MinorVersion </td>
<td> <%= Request.Browser.MinorVersion %></td>
</tr>
<tr>
<td>MSDomVersion </td>
<td> <%= Request.Browser.MSDomVersion %></td>
</tr>
<tr>
<td>Platform </td>
<td> <%= Request.Browser.Platform %></td>
</tr>
<tr>
<td>Tables </td>
<td> <%= Request.Browser.Tables %></td>
</tr>
<tr>
<td>Type </td>
<td> <%= Request.Browser.Type %></td>
</tr>
<tr>
<td>VBScript </td>
<td> <%= Request.Browser.VBScript %></td>
</tr>
<tr>
<td>Version </td>
<td> <%= Request.Browser.Version %></td>
</tr>
<tr>
<td>W3CDomVersion </td>
<td> <%= Request.Browser.W3CDomVersion %></td>
</tr>
<tr>
<td>Win16 </td>
<td> <%= Request.Browser.Win16 %></td>
</tr>
<tr>
<td>Win32 </td>
<td> <%= Request.Browser.Win32 %></td>
</tr>
</table>
</body>
</html>
| |
|
|
|
View highlighted Comments
User Comments on 'HTTP Browser Capabilities with ASP.NET'
|
Posted by :
Archive Import (Frank Oldale) at 13:49 on Thursday, November 14, 2002
|
This is great and easy to use but what I really need is something that tells me if there allowing cookies etc. The examples only tell you that the browser is capable of these things
Any ideas?
| |
Posted by :
Archive Import (Bill) at 07:25 on Wednesday, December 04, 2002
|
For security reasons there is no way to absolutely determine the actual user capabilities, the best you can do is guess based upon the browser capabilities with the above code.
----- siriusweblabs.com
| |
Posted by :
Archive Import (nik) at 12:08 on Thursday, January 02, 2003
|
you can try writing a cookie, then reading it again before moving on in the code.
| |
Posted by :
Archive Import (SmartWebAgent) at 03:36 on Thursday, January 16, 2003
|
This is a great illustration, but I would like to see the security questions we need to ask when using WinForms and the .net framework as well as the mobile and security questions we should ask when building ASP.NET Mobile and Compact Framework (SDE) applications. Otherwise, great intro article for those just getting started.
| |
|
|
|
To post comments you need to become a member. If you are already a member, please log in .
| RELATED ARTICLES |
ASP FilesystemObject by Jeff Anderson
An introduction to the Filesystemobject |
 |
ASP GetTempName by Jeff Anderson
Use the GetTempName method to create a randomly generated temporary file on the server. |
 |
ASP OpenTextFile by Jeff Anderson
An introduction to the OpenTextFile Method of the FileSystemObject |
 |
ASP Format Date and Time Script by Jeff Anderson
An ASP script showing the variety of date and time formats possible using the FormatDateTime Function. |
 |
Email validation using Regular Expression by Jeff Anderson
Using regular expression syntax is an exellent way to thoroughly validate an email. It's possible in ASP. |
 |
ASP FileExists by Jeff Anderson
An introduction to the FileExistsMethod of the FileSystemObject |
 |
Creating a Dynamic Reports using ASP and Excel by Jeff Anderson
A simple way to generate Excel reports from a database using Excel. |
 |
Concatenate strings in sql by Jeff Anderson
A brief introduction to concatenating strings in an sql query (using SQL server or access databases). |
 |
Add or Subtract Hours in SQL or ASP using DateAdd by Jeff Anderson
A beginners guide to using the SQL DATEADD function to add or subtract hours. Particularly useful when setting the time displayed on the ASP page to a different time zone (eg when the server is in the US, and the site is for a UK audience). |
 |
ASP CreateTextFile by Jeff Anderson
An explanation of the CreateTextFile Method, part of the ASP FileSystemObject |
 |
| |