Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
Abstract: Most Active Server Pages (ASP) applications use string connections to create HTML-formatted data that is presented to users. This article compares several methods for creating this HTML data stream. In specific cases, some methods are superior to other methods in terms of performance. This document assumes that you have some ASP and Visual Basic programming knowledge.
When compiling an ASP page, the developer actually creates a formatted text stream and writes it to the Web client through the Response object provided by ASP. There are multiple ways to create this text stream, and the method you choose will have a great impact on the performance and scalability of Web applications. Many times, when I helped customers optimize the performance of their Web applications, I found that one of the more effective methods is to change the way HTML streams are created. This article will introduce several common technologies and test their impact on the performance of a simple ASP page.
Many ASP developers follow good software engineering principles and try to modularize their code as much as possible. This design usually uses some include files that contain functions that are formatted and generated for specific discontinuous parts of the page. The string output of these functions (usually HTML table code) can be combined to create a complete page. Some developers have improved this method by moving these HTML functions to the Visual Basic COM component to take full advantage of the additional performance provided by compiled code.
Although this design method is good, the method used to create strings that comprise these discontinuous HTML code components will have a great impact on the performance and scalability of the Web site, whether the actual operation is performed in the ASP inclusion file or in the Visual Basic COM component.
See the following code snippet of the WriteHTML function. The parameter named Data is just a string array that contains some Data to be formatted as a table structure (for example, Data returned from the database ).
Function WriteHTML (Data)
For nRep = 0 to 99
SHTML = sHTML & vbcrlf _
& "<TR> <TD>" & (nRep + 1) & "</TD> <TD> "_
& Data (0, nRep) & "</TD> <TD> "_
& Data (1, nRep) & "</TD> <TD> "_
& Data (2, nRep) & "</TD> <TD> "_
& Data (3, nRep) & "</TD> <TD> "_
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to firstname.lastname@example.org. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.