ASP. NET Ajax Server Page Process

Source: Internet
Author: User

Obviously, scriptmanager and updatepanel are the two most important classes in ASP. NET Ajax.

Use reflector to view Microsoft. web. extensions. DLL class, found that there are many interfaces, such as ihtmlform, ihttpbrowsercapabilities, ihttpcachepolicy, ihttpcontext, ihttprequest, ihttpresponse, ipage, etc., encapsulated system. some methods of corresponding classes in the Web, as well as some Wrapper Classes, such as htmlformwrapper, handler, httpcachepolicywrapper, httpcontextwrapper, httprequestwrapper, httpresponsewrapper, and pagewrapper. the corresponding class objects in the Web implement the methods of the above interfaces. It seems that there will be a lot of refactoring in the next version of ASP. NET!

Taking a closer look at the implementation of the scriptmanager class, we found that many functions are abstracted and encapsulated in the pagerequestmanager class (the client has a class with the same name.

The process for getting the page from the beginning is as follows:


The general process of partial update PostBack is as follows:

Pagerequestmanager is used in the isasyncpostbackrequest () method to analyze whether the value of "Pragma" in headers is "deltea = true" to determine whether it is a local update mode. Then, find out which updatepanel needs to be updated and which element causes the PostBack in the loadpostdata () of the scriptmanager execution. Remember that as mentioned earlier, during partial update, similar to "scriptmanager1 = updatepanel1 | btnupdate &.... "The data is submitted to the server. Then, when the scriptmanager onprerender () is executed, the pagerequestmanager class calls setrendermethoddelegate () of the page class. By setting a rendermethod, The pagerequestmanager class actually takes over the display output logic.

 

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.