Using Aspnet Components

The following code is a sampling of all the information that you can collect about a Web browser by using the HTTPBrowserCapabilities object. See ASPBrowserCapabilities_ai.aspx on the CD for the full example.

TYPE THIS:

<H3><%=Request.Url.ToString()%></H3>

Here is all the data from Request.Browser.<P/>

HttpBrowserCapabilities hbcBrowser = Request.Browser;

Response.Write( "Type = " + hbcBrowser.Type + "<BR/>" );

Response.Write( "Name = " + hbcBrowser.Browser + "<BR/>" );

Response.Write( "Version = " + hbcBrowser.Version + "<BR/>" );

Response.Write( "Supports Frames = " + hbcBrowser.Frames + "<BR/>" );

Response.Write( "Supports Tattles = " + hbcBrowser.Tables + "<BR/>" );

Response.Write( "Supports Cookies = " + hbcBrowser.Cookies + "<BR/>" );

Response.Write( "Supports ActiveX Controls = " + hbcBrowser.ActiveXControls + "<BR/>" );

RESULT:

http://localhost:81/new/ASP BrowserCapabilities_ai1. aspx

Here is all the data from

Request.Browser. Type = IE6 Name = IE Version = 6.0b Supports Frames = True Supports Tables = True Supports Cookies = True Supports ActiveX Controls = True

Q Save the file.

_Q Create a case statement using the string variable.

_Q Add a case for each of the options that redirects to the appropriate page.

Q Save the file.

• Copy IE.aspx and Other .aspx from the CD-ROM to your working directory.

, Request the file from the Web server.

■ You are redirected to a page according to your Web browser type.

Was this article helpful?

0 0

Post a comment