ASP Basics Introductory Tutorials (1)

Source: Internet
Author: User
Tags format expression functions html page html tags http request variables variable
Tutorials | Getting Started Tutorials

  What is an ASP

ASP is the abbreviation of active Server pages, which contains three aspects of content

1 Active

Active refers to the ActiveX technology, which uses encapsulated objects, program invocation objects, and other methods to simplify programming, so that we can easily quickly build Web applications;

2 Server

Server refers to ASP programs running on the server

3 Pages

Pages refer to the return of standard HTML pages

ASP is an alternative to CGI, powerful, simple and easy to learn Dynamic Web page technology


  Two what is static Web page

A static web page refers to a Web page that consists of only HTML tags. static Web page is not to say what content in the Web page is still, inside the text is also can be movement, inside also can see Flash animation, etc., but it presents to each visitor in front of the content is the same, it will not vary the content of different;

  Three what is Dynamic Web page

Dynamic Web page refers to the Web page not only contains HTML tags, in the HTML tag also contains the program can be executed, so you can achieve dynamic interactive Web pages, for different visitors can show different content, chat room and BBS forum is its typical application;


  Four Configuration ASP running environment

The main steps to running an ASP must be configured to run the environment are as follows:

1 Installing IIS

Select Start > Settings > Control Panel > Add or Remove Programs, or Start > Control Panel > "Add/Remove Programs". Select Add/Remove Windows components. Select Internet Information Services (IIS), and then click Next. Follow the installation instructions.

2 Setting up the native Web server

(1) New folder Inetpub and its subset folder in D disk Wwwroot

(2) Control Panel-management tools-internet Information Service-right-click Default Web Site-Properties-Home directory-fill in the local path, D:\Inetpub\wwwroot-OK;

(3) Right-click the Default Web site-new-Virtual Home directory-alias fill wwwroot-Next-directory fill \inetpub\wwwroot-next check in the Write bar-ok

3 Testing the native Web server

To test your Web server, create a simple HTML page named "ss.html" and save it in the Inetpub\Wwwroot folder on the computer where the Web server is running. The HTML page can consist of one row, for example:

<p> My web server is working </p>

The test page is then opened in a Web browser with an HTTP request. If IIS is running on your local computer, enter the following URL in the Web browser:

Http://localhost/ss.html

If your browser displays your page, the WEB server is running fine.

  Five ASP Basics

1 ASP files

ASP file suffix named. asp, in the ASP file will typically include HTML tags and ASP script commands, ASP script commands in the ASP defined <%...%>

2 The setting of the main scripting language

By default, the ASP main scripting language is VBScript, or you can change the main scripting language as needed, such as setting JavaScript as the primary scripting language:

<% @ language=javascript%>

3 ASP's output instructions

To observe the operation of the program, you must use the output instructions, output instructions to display functions, variables, strings and other content, the output method is as follows:

Format 1: <% = Expression%>

Format 2: <% Response.Write (expression)%>

Or remove the parentheses and add a space

<% Response.Write Expression%>

Sample sp1.asp

<title>asp Simple Program </title>
<body>
Your visit time is: <% = Now%>
</body>

  Sample Sp2.asp

Displays a string constant;

<title>asp Simple Program </title>
<body>
Display string constants: <% Response.Write "Everyone good"%>
</body>

Sample sp3.asp

This example uses variable B to save some text, and then use the output instruction to display B, B is a variable without prior declaration, which is allowed in vbscipt;

<title>asp Simple Program </title>
<body>
<%
b= "ASP is Microsoft's introduction to replace the CGI Dynamic Web page technology, ASP is the development of the Web under IIS programming Tools"
Response.Write (b)
%>
</body>

From the example above we learned the Response.Write () output statement, which can be used to display the values of functions, strings, or variables.



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.