ASP Development Specification-write this thing please advise, later development good less to eat a bit of pain.

Source: Internet
Author: User
Tags functions modify variables client
Standardize the development of the specification of ASP Development code-write this thing please advise, later development good less to eat a bit of pain.

One, one-page writing specifications:
Remember that the page needs to be divided into modules:
First module: Receive parameters. [It is possible to submit from different pages to the same page, or you can see which of the two form items is treated as a priority.
Second module: Define global variables.
The third module: Write processing code (as much as possible to include the code in the function, see page Note one.) )。 --Complete the main part of this ASP code.
Module four: Pure HTML code that uses the values stored in global variables to generate pages.
Five (note): To write the page logic on the head of the page. (How to receive and process.) )
Advantages: Easy to maintain. The module is self-contained and facilitates reuse to similar pages.

Second, the whole station file construction specification:
1. After the project took over, watch the static page, grasp the logic and the order of navigation.
2. Extract the site to be reused to make embedded files.
3. Extract the header file, the tail file, and the left menu bar, made into embedded files.
4. Divide the page structure, make the template file. --Copy it later in production, and then it can be directly produced.
Note: Don't be in a hurry to write a page, unless you're taking on a small project, or the user's needs are very clearly defined and won't change, otherwise, it's important to keep the page code readable! (How are you feeling when you face the big rework?) Consider the potential danger first! )
-Because each of us understands the code we write, it's harder to read the code that someone else writes. And, due to changes in customer demand, it is more common to modify or even overthrow the original design. So pay attention to write code when the attention of the latter to quickly read, and easy to modify. [It is necessary to add a note to the head of the page, in an important part of the code, as well as some explanatory comments.] ]


All we do is just to: increase portability, make logic clear, facilitate maintenance,
Adapt to changes in user needs, and complete as soon as possible, reduce the effort.
――――――――――――――――――――――――――――――――――――――

Note I: The third module prepares a description. ASP page Authoring Structure
1. Write notes First
2. Write embedded file.
3. Write large chunks of ASP code (removed from COM)
--Note: complex pages, try to encapsulate different COM operations in separate functions;
--there is a call at the end of the function, the data that is processed by the function directly in the following page (has been assigned to the global variable)
--to validate the validity of the page entry parameters before calling the function.

Note II: Note Fourth module preparation. Part of the HTML code that needs attention
1 It is best not to make the page's ASP code and HTML code mixed together,-feel more confusing.
2 Obtain the data of the global variable to get the processing result of ASP.
3 About client javascript:
Verify the validity of the form before submitting it. Written in front of the <form tag, the function name example: Frmcheck1 ();
To the dropdown box to have and hide the button synchronization, write out a separate small function, placed under the button.
For large innerHTML-type client interaction, write the code in front of the corresponding <div label.
Write client script, you can write more functions, so that the parameters passed between functions, simple, so that there will be similar pages in the future, can be removed and then used.

Requirements for Web page production:
Web page personnel to complete the page, in order to ensure that there will be no confusion in use, please do the following processing:
1. Do not nest too many forms;
2. The width of the table should be defined by pixel width;
3. Single page, a function module to make a table, in order to write the page, the duplicate part of the extracted into the embedded file.
4. Other note: Thin code, note the width of characters and borders in the table.
5. Name in English lowercase plus digit (and half-width underline). [Think about the horrors of your page moving to UNIX hosts]


2001-5-21




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.