locked
Require Async="true" ASP.NET 2.0? RRS feed

  • Question

  •  

    Is it possible to run asynchronous threads in an ASP.NET 2.0 web application when the page does not have Async='true'?  What is required since the PageAsyncTask cannot be used in this case.
    Monday, October 29, 2007 12:22 PM

Answers

  • <trust level="WSS_Minimal" originUrl="" />

    Was causing problem (i.e. Code Access Security), required to assert SecurityPermission in another Trusted wrapper for the ExecuteRegisteredAsyncTasks() not to throw exception.  Cannot execute directly inside web part with minimal trust set.
    Monday, November 5, 2007 6:26 PM

All replies

  • Check out the link...

     

    http://msdn2.microsoft.com/en-us/library/system.web.ui.page.executeregisteredasynctasks.aspx

     

    Search for "... for a non-asynchronous page.... " on that page.

     

    Hope it works out for you.

    Friday, November 2, 2007 12:34 AM
  • If I ignore the status of

    this.Page.IsAsync == true

     

    the follow error occurs when Page is not set to run asynchronous

     

    [HttpException (0x80004005): Exception of type 'System.Web.HttpException' was thrown.]
       System.Web.UI.Page.ExecuteRegisteredAsyncTasks() +2045835

     

    Everything works fine if the Page includes Async="true", but the requirement is to run web part asynchronous, and web part has no control of initial page markup, so how to run asynchrous when Async is not set and still run asynchronous.

    Friday, November 2, 2007 2:45 PM
  • <trust level="WSS_Minimal" originUrl="" />

    Was causing problem (i.e. Code Access Security), required to assert SecurityPermission in another Trusted wrapper for the ExecuteRegisteredAsyncTasks() not to throw exception.  Cannot execute directly inside web part with minimal trust set.
    Monday, November 5, 2007 6:26 PM