|
Rank: Member Groups: Member
Joined: 9/1/2010 Posts: 28
|
I have a server code task which runs during a progress bar display (startTask). In the server side OnRunTask handler I save an object in session. Then in the ClientSideOnTaskDone client handler I update a callbackpanel (in a master page). In the Callbackpanel's OnExecute server handler, I try to get the object from the session but it's null?
What's the best way to pass an object in the workflow I described?
I saw a post about saving the session in a file as in: e.UpdateProgress(100, "../temp/" + session_file); Is this the only way to pass the object? It seems I have to serialize the object in the file and then deserialize it upon reading. I prefer not to deal with files.
I am thinking of not using the runTask. i don't need to send updates to the progress bar. Just to close it when server code is done.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You can try to use setTimeout to delay your callback and see if it works. Using a separate file obviously will work, but then you will have to delete it.
Thanks
|
|
Rank: Member Groups: Member
Joined: 9/1/2010 Posts: 28
|
Thanks. I had a sleep of 3 seconds while I was testing so it doesn't seem to be a delay issue. I ended up serializing the object to XML, sending it to the client which sent it to the callbackpanel which deserialized it.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
I do not know why the session variable is not saved. However I am glad to hear that you found a solution.
|
|