Like most language scripts, the best way to learn ASP is to try ASP and install PWS or IIS on your own system. You can test ASP components and functions on your server while learning. For ease of learning, we have compiled some operation scripts to let you feel the strength and flexibility of ASP and help you build your vbscripting vocabulary.
Transfer from: dynamic network Production Guide www.knowsky.com
To learn ASP, you can browse the source code of other websites. In fact, the ASP part of your page can be performed before the content is written to the screen. Therefore, you can write this on your page:
<% Response. Write "Your name is" & strname %>
When you browse the code on this page, you will see (if your name is "Jane ."):
Your name is Jane
Your page may contain a large number of scripts or a total of scripts, but what you see from the code browsing command is 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>
The ASP script contains Hello world, which is displayed on the screen.
Congratulations to your users
The Hello world sample uses the information we provide. In the same way, you can use the built-in VB Script Function to access some information, such as data and time ,. For example, if you do not need to put the current time on any page, it will be automatically loaded to your page:
It is now <% = time %>.
You can select the style and context of time display. As long as ASP is partially included, the local server writes it to the screen.
Whether to select the sample test can be used to further enhance this example, or, if you want to know something about the box, you can use time as a variable to test to change the background color, font color, welcome language, or even determine which page is displayed.