简体   繁体   中英

Asp.Net 4.0 Async Errors

I have a website that seems to work perfectly well in development.

ScriptManager.GetCurrent(this).AsyncPostBackTimeout = 3600;

One of the pages uses an update panel and a web service (web client). Despite setting the timeout above, I still get the following on the server:

at System.Web.HttpContext.Invoke Cancellable Callback(WaitCallback callback, Object state) 
at System.Web.UI.Page.LegacyAsyncPageBeginProcessRequest(HttpContext context, AsyncCallback callback, Object extraData) 
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I noticed on the aspx page it's set to "async=true" - I don't know why or what it brings to the party in this instance, but I've removed it and the site still works.

The page also has a response.redirect with the bool end = false;

Can anyone enlighten me as to what the async could be there for? Also any indicators on the error would be appreciated too.

Finally got to the bottom of this - now working perfectly, so here how.

The problem was that I had a long running webservice-although it could be any long running job.

I added a timeout to my webclient (custom), and because I was using update panels, I also added:

ScriptManager.GetCurrent(this).AsyncPostBackTimeout = 600;

However this still wasn't enough. The key was also put an extended time out on the page request itself:

Server.ScriptTimeout = 600;

Hope this helps others.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM