As we learned in the previous chapter, an ASP page is a mix of text, HTML tags and server-side script blocks. The server script blocks in ASP are always surrounded by the <% and %> delimiters, which tell the ASP ISAPI filter which part of the ASP page has to be executed. Server scripts are executed on the server, and the result sent to the browser is just plain HTML & text.
A server-side script block is a sequence of instructions sending commands to the IIS. You can use VBScript and JavaScript as scripting languages in ASP. If you don’t specify a scripting language at the top of your ASP page, IIS uses VBScript as default scripting language. This tutorial uses VBScript as a default scripting language for all examples.
Here is an example of a very simple ASP page:
<HTML>
<BODY>
My first ASP page was executed on <%= Now() %>.
</BODY>
</HTML>
The only server-side script above contains the Now() VBScript function, which returns the current date and time. When IIS executes this ASP page, it replaces <% = Now() %> with the current date and time and you will see the following in your browser:
My first ASP page was executed on 11/09/2004 1:13:12 PM
|