Test results on the maximum efficiency of ASP writing to the response stream

Source: Internet
Author: User
This tutorial describes how to Write ASP-generated content to the most effective method in the Response stream, that is, to test the efficiency when outputting content to the client using Response. Write and <% = %>.
One of the main reasons for using ASP is to generate dynamic content on the server. Obviously, the starting point of our test is to determine the most suitable method for sending dynamic content to the response stream.
Among the multiple options, two are the most basic: one is to use the inline ASP tag, and the other is to use the Response. Write statement.
To test these options, we created a simple ASP page with some variables defined and their values inserted into the table. Although this page is very simple, it is not very practical
But it allows us to separate and test some separate issues.
Use ASP inline flag
The first test involves marking with inline ASP <% = x %>, where x is a variable with a value assigned. So far, this method is the easiest to execute, and it makes the HTML part of the page
Maintain a format that is easy to read and maintain.
<%
Option explicit is used to define each variable before it can be used.
Dim FirstName
Dim LastName
Dim MiddleInitial
Dim Address
Dim City
Dim State
Dim PhoneNumber
Dim FaxNumber
Dim EMail
Dim BirthDate
FirstName = "John"
MiddleInitial = "Q"
LastName = "Public"
Address = "100 Main Street"
City = "New York"
State = "NY"
PhoneNumber = "1-212-555-1234"
FaxNumber = "1-212-555-1234"
EMail = "john@public.com"
BirthDate = "1/1/1950"
%>
<HTML>
<HEAD>
<TITLE> Response Test </TITLE>
</HEAD>
<BODY>
<H1> Response Test </H1>
<TABLE>
<Tr> <td> <B> First Name: </B> </td> <% = FirstName %> </td> </tr>
<Tr> <td> <B> Middle Initial: </B> </td> <% = MiddleInitial %> </td> </tr>
<Tr> <td> <B> Last Name: </B> </td> <% = LastName %> </td> </tr>
<Tr> <td> <B> Address: </B> </td> <% = Address %> </td> </tr>
<Tr> <td> <B> City: </B> </td> <% = City %> </td> </tr>

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.