Start the script to feel the power of the ASP

Source: Internet
Author: User
Tags current time

As with most language scripts, the best way to learn about ASPs is to try out your own ASP, using your own system to install PWS or IIS. You can test ASP components and functions on your own server while you are learning. For ease of learning, we have compiled some action scripts that allow you to feel the power and flexibility of the ASP and help you build your vbscripting vocabulary.

Turn from: Dynamic Network production guide www.knowsky.com
Learn about ASP you can do this by browsing the source code of other websites. In fact, the ASP portion of your page can be done before the content is written to the screen. So, you can write this on your page:

<% 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 large number of script parts or total scripts, but you will see the HTML code from the command to browse the code, which is sent as the output of the. asp page.

Hello World
Now let's look at the Hello World script, copy the following code in the ASP's editor, named 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 is the Hello World, which will be displayed on the screen.

Congratulations to your users
Hello World Samples Use 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, you don't have to put the current time on any page, it will automatically load onto your page:

It is now <%= time%>.

You can choose the time display style and context. As long as the ASP part is included, the local server will write it to the screen.

Whether you choose a sample test can be used to further enhance this example, or if you want to learn something about box, you can use time as a variable to test to change the background color, font color, welcome language, and even determine which page is displayed.




Related Article

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.