I have an ASP.NET application in .NET 1.1 that makes a web service call using the Begin{WebMethod} call and then returns to the page and redirects to another page. The Async callback is returned later when this is done and I log any errors that this web method call may have had to the event log. The web page does not wait for the response because it's role is to fire it off and then go on. I am trying to move to .NET 2.0 and have an issue where the Async call for 2.0 will not allow me to redirect until the web service has completed. I do not need a response from my web service and would like to move on to another web page. I basically have switched to making this a synchronous call as how 2.0 is handling it is synchronous.
Thanks for any and all help.
Hello Mladinichs,
check out the Ajax video that shows how to use client side Async call back.
http://www.asp.net/learn/ajax-videos/video-79.aspx
I hope it helps.
Client side is not really what I'm looking for. The button click is gathering up info from the screen, performing a save operation and then kicking off an async process. Any thoughts?
Hi,
If your wanting to do this on the client side, does this work?
function DoSave(){
YourSavingService.SaveData()
document.location.href = "yourNextURL.aspx"
}
Cheers Si
This application is an existing application in production and I'd rather not re-write this entire functionality to be client-side. Is there no way to do this server-side?
Hi,
I suggest using a separate thread to run the task which is currently running on the main thread of the web service that halts it form return soon.
For instance, say your web service is like this now:
void fun() { doSomething(); }
change it to:
void fun() {Thread thrd = new Thread(new thredInfo(doSomeThing); thrd.Start(); }
No comments:
Post a Comment