Previous PageNext Page

5.1 ASP Scripts

An ASP script contains optional text (usually HTML and/or client-side scripts) interspersed with one or more ASP script blocks. Any valid HTML page is also a valid ASP page, enabling the Web developer to easily transform a static Web site into a dynamic Web site by adding ASP scripts to existing documents.
 
A key feature of ASP is that the scripts run at the server. As each ASP script block is processed, it creates HTML text that is returned to the browser for rendering. The Web developer does not need to be concerned about the capabilities of the browser, all processing is done at the server and only standard HTML is returned. Server-side scripts can not be copied by users since only the output is returned to the browser.
 
Script blocks are set off from text by using delimiters. ASP uses <% and /%> to delimit primary script commands, script blocks in the primary scripting language. By default, the primary scripting language is Microsoft® Visual Basic® Scripting Edition (VBScript), but that can be changed for each page by using the <%@ LANGUAGE> directive at the beginning of your ASP file or for an ASP application on a UNIX system by setting the defaultlanguage parameter in the Chili!Soft ASP configuration file..
 
You can use the <SCRIPT> ... </SCRIPT> tags to set the language for an individual block of ASP script. Normally, a block of code enclosed in <SCRIPT> tags runs on the client side, you can force the block to run on the server by including the runat=server attribute, as in the following example:
 

<SCRIPT language=JScript runat=server>


Copyright © 2000 Chili!Soft

Previous PageTop Of PageNext Page