Introduction to ASP (16)-asp Development specification

Source: Internet
Author: User

There is no doubt that adherence to a set of specifications in development will help improve the readability of the code and lower maintenance costs later on.

File storage Directory Specification

JS directory contains the JavaScript script file that the page uses, because we may use the Free JavaScript Framework library (Prototype.js, JQuery) provided by the third party, so we create the Lib folder specially, Used to store these script files.

The include directory holds our usual functions, and the Lib directory holds the class files for code reuse.

In addition to the folders listed above, we will also set up a few folders, they will not be published, just for their own use.

Programming Style Specification

1, try to make the ASP code and HTML code apart, in the HTML code does not exist large chunks of ASP code, if you can keep the data in the variable, and in the HTML code in the form of the following call, so modify the page layout will be more convenient.

<% = VariableName %>

2, in a page, try to write ASP code in front of the HTML code, so easy to read and modify.

3, at the top of each page are added pretreatment quality, the following form

<% @LANGUAGE = " VBSCRIPT " CODEPAGE = " 65001 " %>

4 . Add the quality of the mandatory variable declaration at the top of each page to avoid errors caused by misspelled variable names. The following form

<%@LANGUAGE="VBSCRIPT"CODEPAGE="65001"%><%Option Explicit%>

5, Loop, judgment and other statements using 2 spaces to indent, more complex statements, even if the comments are indicated

6, integer variable i start, single-precision real variable f start, double precision real D start, character s start, integer array type I_array_ start, constant recommended all uppercase, Function procedure name first letter uppercase

7, any object created with CreateObject, should be released at the end of the page, as follows:

<% Set  =nothing%>

8 . When the data is open, close the connection at the end of the page.

Above just play a role, summed up their own experience, designed to meet their actual programming norms.

Introduction to ASP (16)-asp Development specification

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.