ASP 3.0 new Features sneak peek

Source: Internet
Author: User
If you are using Win2000 and IIS5.0 now, then you can realize that ASP 3.0
The new changes brought about by ...
ASP 3.0 is not particularly altered in relation to ASP 2.0, which is the ASP version in IIS 4.0.
But it also brings some very distinctive enhancements, let's take a look at these new features:
Server.Transfer
This is a new way to control another ASP page from the current ASP page.
It can be used to replace the Response.Redirect method.
An example is provided:
Suppose you want to relocate the user to another new URL after performing some processing.
If you are in as 2.0, your execution process is like this, first execute your process and then use the
Response.Redirect the user back to the URL. The problem with this approach is Response.Redirect
Too bloated (too inefficient to perform)-because this is the first way to send the client's browser a
Message telling the browser that it is now time to relocate to a new URL. And then the browser reads this
Request, and then return a message to the server, requesting the server to locate itself in that URL, and finally
The server will process the new request and pass the HTML to the client.
As can be seen from the above process, a response.redirect leads to a lot of network traffic.
And Server.Transfer is to solve this problem and appear, it can be simply understood as a service-side
URL relocation, that is, it is directly on the server can relocate the URL, without having to do with the client
Too much communication to avoid aggravating network traffic.
The following is a simple example:
' Perform the process you need
...
' Relocate the user to doneprocessing.asp
Server.Transfer "/scripts/doneprocessing.asp"
Server.Execute
? This execute method is somewhat similar to the transfer method described above, but the difference is that the Execute method
will give control to the calling ASP page when the called ASP page finishes execution.
Oh, is not a bit confused ah, let the example to illustrate the problem:
Suppose the code for Page1.asp is as follows:
Response.Write "Hello,"
Server.Execute "Page2.asp"
Response.Write "World!"
And the Page2.asp code is as follows:
Response.Write "Good morning!"
When browsing page1.asp through a browser, the first output is Hello to the client.
Then, the page2.asp is executed, and the result is the good morning! Output to the client.
Finally, control goes back to where Page1.asp left off, and the result is the world! Output to the client.
The result that the client can see at the end is:
Hello, Good morning! World!??
For all this, the client did not know that Page1.asp called page2.asp, and that the browser did not
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.