开发者

Display message afer save is successful BlockUI Update Panel

开发者 https://www.devze.com 2023-01-22 12:40 出处:网络
I want to display a status message after a server side postback. Currently to do this, I use blockUI for blocking a

I want to display a status message after a server side postback. Currently to do this,

  1. I use blockUI for blocking a div while the save is in progress

  2. I unblock the div with a custom End request handler for my update panel

  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号