The ASP Version

ASP allows the programmer to intersperse scripting code snippets within the HTML code. This scripting code can be written in a scripting language such as JavaScript or VBScript. Adding embedded script to your sample web page allows you to insert dynamic content. Modify the previous code listing, converting it to ASP, by changing the filename extension to .asp and adding VBScript to display the current time, as shown in Example 2-2. The output is shown in Figure 2-2.

Example 2-2. Code listing for HelloWorld1.asp

<html>
   <body>

      <h1>Hello World</h1>
      <br/>
      <h2>The date and time is <% =Now%>.</h2>

   </body>
</html>
Output from Example 2-2

Figure 2-2. Output from Example 2-2

It may not look like much, but this represents a vast improvement over static HTML. ASP allows you to create web sites full of rich and dynamic content. The scripting allows for queries, reads and writes against databases, implementation of programming logic, control of the appearance of web pages in response to user actions or returned data, and a host of other features.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.98.207