Welcome Guest Search | Active Topics | Sign In | Register

msgbox doesnt close the window on button click until all process code is executed Options
chuck_farah
Posted: Saturday, March 13, 2010 12:52:03 PM
Rank: Member
Groups: Member

Joined: 12/15/2008
Posts: 21
Just wanted to know if there is a way the msgbox can close as soon as the button is clicked.

For instance i have an ADD button that will go through a long running transaction to add a bunch of records. The behavior is after i click the button it keeps the window up until all the postback code is executed which may give the false impression that the button wasnt depressed.

another choice is to gray out the window or something

any ideas?

eo_support
Posted: Monday, March 15, 2010 9:36:16 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

That is quite normal. The button does not really close the msgbox. It just triggers a post back. You see the msgbox closed because the page is reloaded.

If you wish to see the msgbox closing faster, you will have to separate the two actions: close the msgbox first, then do a postback, which means you have to do them with JavaScript. In order to close the msgbox on the client side, you would clear the button's CommandName property and set its ClientSideHandler. Inside your ClientSideHandler you would delay trigger a post back:

Code: JavaScript
function msgbox_handler()
{
    setTimeout(function()
    {
         //trigger your post back here....
         .......
    }, 10);
}


It is necessary to delay your post back so that the msgbox can continue to close itself after it calls your handler.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.