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.