Like most scripting languages, the best way to learn ASP is to try ASP yourself and install PWS or IIS on your own system. You can test ASP components and functions on your own server as you learn. To facilitate learning, we have compiled some operational scripts to give you a feel for the power and flexibility of ASP and to help you build your VBScripting vocabulary.
<% Response.Write "Your name is" & strName %>
When you browse the code for this page you will see (if your name is "Jane."): Your
name is Jane
Your page may contain a lot of The script section or the total script, but all you see from the browse code command is just the HTML code, which is sent as the output of the .asp page.
Hello World
Now let's take a look at the Hello World script. Copy the following code in the ASP editor, name it a.asp, and open it in the browser.
<HTML>
<HEAD>
<TITLE>Hello World Sample</TITLE>
</HEAD>
<BODY>
<% Response.Write "Hello World" %>
</BODY>
</HTML>
In the middle of the ASP script it says Hello World and it will be displayed on the screen.
Congratulate your users
Hello World samples use information provided by us. In the same way, you can use built-in VB script functions to access some information, such as data and time. For example, you don't need to put the current time on any page, it will be automatically loaded into your page:
It is now <%= Time %>.
You can choose the style and context of the time display. As long as the ASP part is included, the local server will write it to the screen.
If you select the example test you can use it to further enhance this example, or if you want to know something about the box, you can use the time as a variable in the test to change the background color, font color, welcome language or even determine which page be displayed.