Asp example code
Wrapping up our ASP example
Technology Update
GEARHEAD INSIDE THE NETWORK MACHINE
Last week we introduced the IIS Object Model and, specifically, the Request object, which gives you access to the HTTP header and body, and the Form collection, which provides access to all the POST'ed items.
We also outlined a wonderfully eccentric and fabulously pointless Web page that uses Active Server Scripting to create an array of radio buttons with individual scripts related to each button (you can find the article at www.nwfu sion.com, DocFinder: 3829, and the code can be downloaded from DocFinder: 3830).
To continue with our survey of the code: Lines 7 and 8 are HTML with in-line sections of Active Server Page (ASP) script that are replaced by the value of the variables referenced as the count of columns and rows (the variables `intC" and "intR") are each looped through.
So when you load the output page generated by the ASP page and click on a radio button, a message will be displayed announcing which button was clicked. Of course you could create any code you like for the body of each function.
This is a trivial example of ASP programming, but it illustrates some important features.
First, it shows you how ASP is woven into a document and how the results of the script replace and modify the regular
HTML content.
Second, it illustrates that server-side ASP scripting can create client-side scripting. This can be incredibly useful where catalogs or directories are being displayed.
Moreover, in our example we created client-side VBScript but we could have created code in any client-side supported language or for any plug-in or browser service.
Finally, it shows how ASP can be used to generate complex, variable content. In this case we created client-side scripting but we could have created tables, lists, frames, etc.
This requires a different way of thinking about Web content because until the output leaves the server the scripting can treat the HTML content as nonlinearly, as needed, to create the required output.
Copyright Network World Inc. Jan 13, 2003
Provided by ProQuest Information and Learning Company. All rights Reserved.