MSDN Magazine - December 2007 - (Page 43) The submit handler starts its job by composing the body of the request. It does that looping through the input fields in the form and creating a proper string. The body is nearly identical to the body the browser would generate itself except for an extra parameter: ScriptManager1=UpdatePanel1 Again, the IDs here are arbitrary. What matters is that you assign to the ID of the page’s script manager the ID of the updatable panel triggering the call. Once the request is ready, the PageRequestManager first fires the client-side initializeRequest event. The event gives developers a chance to cancel the operation. If the operation can proceed, the manager kills any pending operation—only one partial rendering operation can be active at a time—and fires the beginRequest event to notify that the request is going to leave. Next, it calls invoke on the corresponding WebRequest object. When the response is back, it is parsed to look for errors and the pageLoading event is fired if all is fine. When the pageLoading event arrives, the response has been parsed but not yet merged with the current DOM of the page. Next, the panels involved with the operation are refreshed and any other data coming from the server is processed, including data items and postback scripts. Finally, the pageLoaded event is fired followed by the endRequest event. Each PageRequestManager event has its own class and carries specific information. Code download available at msdn.microsoft.com/msdnmag/code07.aspx. Send your questions and comments for Dino to cutting@microsoft.com. Dino Esposito is a mentor at Solid Quality Learning and the author of Programming Microsoft ASP.NET 2.0 (Microsoft Press, 2005). Based in Italy, Dino is a frequent speaker at industry events worldwide. You can get in touch with Dino at cutting@microsoft.com or join the blog at weblogs.asp.net/despos. Figure 4 Microsoft AJAX Library Built-In Classes (continued from page 38) Network Classes Sys.Net.NetworkRequestEventArgs Sys.Net._WebRequestManager Sys.Net.WebRequest Sys.Net.WebRequestExecutor Sys.Net.WebServiceError Sys.Net.WebServiceProxy Sys.Net.XMLHttpExecutor Service Helper Classes Sys.Services._AuthenticationService Sys.Services._ProfileService Sys.Services._RoleService Sys.Services.ProfileGroup Event Data Classes Sys.ApplicationLoadEventArgs Sys.CancelEventArgs Sys.EventArgs Sys.EventHandlerList Sys.PropertyChangedEventArgs Utilities Sys.Serialization.JavaScriptSerializer Sys.StringBuilder Partial Rendering Classes Sys.WebForms.PageRequestManager Sys.WebForms.PageLoadingEventArgs Sys.WebForms.PageLoadedEventArgs Sys.WebForms.InitializeRequestEventArgs Sys.WebForms.EndRequestEventArgs Sys.WebForms.BeginRequestEventArgs Sys.UI._UpdateProgress Sys.UI._UpdateProgress Description Defines the data associated with the Web request events. Internal class representing the centralized manager of Web requests used to set global parameters such as executor and timeout. Represents a Web request being made. Represents the object in charge of physically executing a Web request. Wrapper class for any exceptions occurred during a service call. Defines the foundation for JavaScript proxy classes of remote services. Represents the Web request executor that uses XMLHttpRequest. Description Internal wrapper class for the server-side authentication Web service. Internal wrapper class for the server-side user profile Web service. Internal wrapper class for the server-side role Web service. This class is only available in ASP.NET 3.5. Used to contain the information about profile groups. Description Defines the data associated with the pageLoad event. Defines the foundation for the data object of any interruptible event. Defines the foundation for the data object of any event. Helper class used to gather all events associated with the execution of Web requests. Defines the data associated with the property-changed event of Microsoft AJAX Library components. Description Helper class used to deserialize ad hoc data inserted in the page and consumed by the Sys.CultureInfo object. Used to concatenate strings, the object works in much the same way as the managed StringBuilder class. Description Root object orchestrating any partial rendering requests and operation. Defines the data associated with the pageLoading event. Defines the data associated with the pageLoaded event. Defines the data associated with the initializeRequest event. Defines the data associated with the endRequest event. Defines the data associated with the beginRequest event. Client-side class to perform update progress operations. Client-side class to perform update progress operations. Cutting Edge december2007 43 http://msdn.microsoft.com/msdnmag/code07.aspx http://ASP.NET http://weblogs.asp.net/despos http://ASP.NET
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.