I have a webform1.aspx page that takes in user selections from a DataGrid. When the user clicks the submit button I issue a Server.Transfer to a second aspx page (Processing.aspx). I do this becuase I want the page to show a Message to the user that a process is running. I will do some network access stuff in this processing page which could take up to 30 sec or less. If any of the processes fail, I hope to transfer back to the first page with an error message but if the processes are successful then I want to post to a success page.
Does anyone know the best way to handle this type of situation? I tried multiple Panels in one aspx page, but how can I make the Processing panel post to the user while the processes keep running ? Can you force a render of the page? I figure I will need to start threads that would send messages to a Deleagate to update the webpage when the threads complete processing. Any thoughts on this? Any help would be appreciated. Thank you for your time.Server.Transfer only transfers the processing to the second page. To actually deliver something to the user, you need to finish the request. I would use Response.Redirect to a page that showed a "Processing" message, then Response.Redirect back to page 1 if error, or Response.Redirect to page 3 if success.
I'm sure there are other ways to do it, but this is the simplest.
Thanks Darrell. I looked more into Response.Redirect() instead of Server.Transfer(). I have solved my problem now by searching on Redirect:
http://msdn.microsoft.com/msdnmag/issues/03/12/DesignPatterns/default.aspx
Good deal.
0 comments:
Post a Comment