Monday, July 16, 2007

Leaving the page when Update Panel is processing

When updatepanel is processing, we may not be able to leave that page. If you forcefully leave that page, then memory leak or long pending server side process will take place and IE will hang for some time.

Resolution:
1. Have UpdateProgress and have "Abort Process" button and call


function AbortPostBack() {
if (Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) {
Sys.WebForms.PageRequestManager.getInstance().abortPostBack();
} }

2. Write Javascript on body unload and call AbortPostBack() method. You may have this in Master Page.

No comments: