October 2010
Intermediate to advanced
1920 pages
73h 55m
English
As you learned in the previous section, you can perform at most one asynchronous postback in a page at a time. By default, the last postback wins. If you initiate a new postback while a previous postback is being processed, the previous postback is aborted.
If you want to reverse this logic, and give precedence to the first postback over future postbacks, you can cancel every postback that occurs after the first postback until the first postback completes. The page in Listing 38.13 illustrates how to cancel an asynchronous postback in the event handler for the PageRequestManager.initializeRequest event (see Figure 38.10).
Figure 38.10. Canceling an asynchronous postback.
Listing 38.13. UpdatePanelCancel.aspx ...
Read now
Unlock full access