ASP 3.0 Object Model Overview

Source: Internet
Author: User
Before studying the details of the ASP from a programmatic perspective, you must look at the ASP object model. This is very important. Because if you do not do the same work on ASP 2.0, you must consider how the ASP generates the page.
Object Environment Concept
In version 1. In 0, it is an exciting new way to add some dynamic content to a Web page. You can use it to read data from the database or manipulate the values that are sent from the browser. In ASP 2.0, a number of very noticeable changes have taken place, adding Microsoft Transaction Server (MTS), which can handle multiple concurrent component instances and provide further scalability. This means that the whole concept of Dynamic Web page work has changed.
On this basis, MTS allows the use of transactions that are distributed across multiple components, applications, and services. For example, an ASP page can update a local database when a message is sent to a remote computer through the messages Queue Service (formerly MSMQ). If a portion of the entire transaction fails, the entire process is restored to the original state of the system.
MTS, as well as the increasingly extensive use of components, has led to the development of Web applications using ASP, rather than a single, simple dynamic page. The environment for this ASP page is available within the component that is instantiated by the ASP script. The environment contains all the internal ASP objects (which we will soon encounter). Therefore, you can use it to obtain the information requested by the user and create a corresponding response.
Because this environment contains the entire ASP's object model, it allows programmers more control over the complexity of the processing of the ASP and the components used. It is generally assumed that the "root" of the object model is the request, response, and other internal objects, and that the real case is (since ASP 2.0), and this root is an object known as the object context.
1. Environments that reference ASP pages
In ASP 1.0, the only way to reference an environment is through an ASP-generated event: OnStartPage, each time the ASP page is started. This event provides an object context object for an ASP page with an argument. Within a component, a reference to the object context can be captured in a global variable for code use. For example, the following VB code stores the environment in a local variable called the obj context.
As you can see from the code above, in ASP 1.0, the environment for an object is the scripting context type, which is an object type defined in ASP.DLL and is used to create code that references a file ASP.dll. It is clear, however, that controlling transactions and providing efficient out-of-process component execution (one of the tasks of MTS Management in ASP 2.0) must take a different approach. The page environment must be explicitly available, without having to keep a reference to it at the beginning of each page.

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.