Display message afer save is successful BlockUI Update Panel
I want to display a status message after a server side postback. Currently to do this,
I use blockUI for blocking a div while the save is in progress
I unblock the div with a custom End request handler for my update panel
- To display status messages, I use scriptmanager's registerstartupscript() in my try catch block on server side code. All works well, however this displays the status messages before the div is unblocked.
How do I show my success/e开发者_如何转开发rror messages only after the div has been unblocked ?
You can try pageLoading
or pageLoaded
script manager event handers instead of endRequest
, i.e.:
<script type="text/javascript" language="javascript">
Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(PageLoadingHandler);
function PageLoadingHandler(sender, args)
{
// hide your blockUI div here
}
</script>
-----------------
Or you have another option. Write message on server callback to hidden field and then in your endRequest
handler hide div, check if there is message in hidden field and if message exists display it.
精彩评论