Unveil ASP secrets (1)

Source: Internet
Author: User
ASP basics
    
Author: mi Xiansheng
    
1: Introduction to ASP
ASP is composed of static HTML and dynamic ASP code. A major advantage of ASP is that it can include the running results of your server scripts on the client. To distinguish the start position and end position of the Code, <% ASP Code %> is used in ASP, where <% is the start mark of ASP Code; %> is the mark of ASP termination; ASP Code is any ASP Code. (Source code)
    
2: script language selection
You can also use the <Script> flag in ASP, but you must set your RuanAt parameter to set its value to your server, otherwise, your code will be sent to the client browser for processing. By default, IIS considers your ASP code to be written by VBScript. Of course, you can also use JScript. You only need to use the Processing Command <% @ LANGUAGE = VBSCRIPT %> at the top of the page to declare it. Note, this statement must be in the first line of the page, and there must be a space between the LANGUAGE and. Of course, you can also specify different scripting languages on the page. For example, you can set the main scripting language to VBScript and then use the JavaScript language. The format is as follows:
<% @ LANGUAGE = VBScript RUNAT = Server %>
<Html>
.....
<Body>
.....
<Script language = "JavaScript" runat = "Server">
.....
</Script>

.....
<Body>
<Html>
    
3: Use of code
In VBScript, annotations are expressed by single quotation marks ('). Variables in VBScript are case insensitive. ASP built-in objects and functions and structures in VBSCript are case insensitive. In VBSCript, a variable must start with a letter and cannot exceed 255 characters. It can contain letters and numbers, but cannot contain periods and other special symbols. You do not need to declare variables in VBScript. Of course, you can declare it in advance. Using the Option Explict statement means that all variables must be declared in advance. The variables declared by VBScript are Variant data types. When you assign a value to a variable, you decide how to store the variable. Note: When we use a variant to save objects, we need to use the Set statement to assign values.
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.