Chapter 3. Extending Active Server Pages

Chapter 1, presented a very brief overview of the Active Server Pages application paradigm. This chapter covers the various extensions for ASP. Some of these are included with IIS 4.0 and ASP 2.0, and some are available via the World Wide Web.

Extending Active Server Pages applications usually takes the form of instantiating server-side objects that expose methods and properties that you can access through your server-side code. Microsoft includes many of these Active server components with IIS 5.0. For example, one of the server components included with IIS is the Browser Capabilities component. Once instantiated, a Browser Capabilities object allows you to discern details about the user's web browser: what scripting it supports, what platform it is running on, and so on. This component allows you to dynamically alter your site in response to the presence or absence of certain browsers.

As will be discussed in Chapter 9, you use the CreateObject method of the Server object to instantiate a server component. For example, to create a MyInfo object in your Active Server Page, you could use code similar to the following:

<%
' Declare local variables.
Dim objMyInfo

' Instantiate a MyInfo object.
Set objMyInfo = Server.CreateObject("MSWC.MyInfo")

' You can now initialize the values.
objMyInfo.PersonalName = "A. Keyton Weissinger"
...[additional code]
%>

As you see in this example, instantiating these server components is simple. Once instantiated, ...

Get ASP in a Nutshell, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.