Feel the strength of ASP by starting scripts

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.