Welcome Guest Search | Active Topics | Sign In | Register

Server Side Progressbar with Client Side Confirmation needs to return a value Options
Indiana
Posted: Friday, June 12, 2009 6:50:13 AM
Rank: Newbie
Groups: Member

Joined: 6/12/2009
Posts: 3
Hello,
I have a server side progressbar and I update progress while also passing the second parameter to send extra options to the Client Side. In the ClientSideOnValueChanged event depending on the extradata parameter I need to get a confirmation from the user. After the user confirms what he wants to do I need to send the response back to the server. I know that the server side event and the client side event execute asynchronously and to be able to pause execution I start a While Statement with a thread.sleap(1000) statement inside the RunTask Event immediately after the updateprogress statement. The While statement checks the value of a hidden field. After the user hits the Ok button on the confirm box I set the value of the hidden field. The problem here is that I cannot come up with a way to pass the cheanged value of the hidden field back to the server to continue the process. One way that did NOT work properly was to use a seperate asynchronous post after the user clicked ok in the ClientSideOnValueChanged Event and set the value on the server side, that did the job and the RunTask continued successfully (allthough it took a while) but the rest of the updateprogress commands did not update the progressbar control anymore. Please note that the RunTask event does some heavy database operations that can't be accomplished client side.

Any help would be greatly appreciated
eo_support
Posted: Friday, June 12, 2009 8:51:44 AM
Rank: Administration
Groups: Administration

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

You shouldn't do the confirmation within a single run because you will not be able to have a second post back to the server while your server side RunTask is still running. You will need to exit RunTask and present the confirmation message to the user. Then depending on whatever user chose, to perform the post back and carry out the additional task in a separate function.

Thanks!
Indiana
Posted: Friday, June 12, 2009 8:59:45 AM
Rank: Newbie
Groups: Member

Joined: 6/12/2009
Posts: 3
Thank you for the reply. I have already achived a second asynchronous postback and resumed the RunTask event in a single run as I described in my previous post. The problem is that although the RunTask event continues and completes successfully the UpdateProgress command does not update the control anymore.
eo_support
Posted: Friday, June 12, 2009 9:11:37 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Indiana wrote:
The problem is that although the RunTask event continues and completes successfully the UpdateProgress command does not update the control anymore.


That's exactly why you can not use them in a single run. :) RunTask is a very special event. Most standard ASP.NET stuff don't work with this event. For example, you can not update anything else other than the ProgressBar, let alone to have a second asynchronous postback. The event is designed to handle progress update only so it can not handle any other scenarios. Thus if you wish to do anything more than updating progress status, you should exit RunTask and "bring" back the page to a "normal" stage. Once you are back in the "normal" stage, you can perform whatever you would like to do.

Note that exiting RunTask does not mean your progress bar has reached its end. You can exit RunTask at 50% and once user confirms the action, starts a second run and continue from 50%. You can even put the ProgressBar inside a CallbackPanel so that your post back between the first and second run won't reload the whole page and give the visual impression that the ProgressBar indeed is waiting for user confirmation.

Thanks!
Indiana
Posted: Friday, June 12, 2009 9:22:23 AM
Rank: Newbie
Groups: Member

Joined: 6/12/2009
Posts: 3
Ok I understand your point exactly. I will continue as you proposed.
Thank you very much for the support.


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.