Geeks With Blogs

News My Blog has been MOVED to
Michael Freidgeim's OLD Blog My Blog has been MOVED to
Recently I needed to implement PageAsyncTask  in .Net 4 web forms application.

"A PageAsyncTask object must be registered to the page through the RegisterAsyncTask method. The page itself does not have to be processed asynchronously to execute asynchronous tasks. You can set the Async attribute to either true (as shown in the following code example) or false on the page directive and the asynchronous tasks will still be processed asynchronously:

<%@ Page Async="true" %>

When the Async attribute is set to false, the thread that executes the page will be blocked until all asynchronous tasks are complete."

I was worry about any site effects if I will set  Async=true on the existing page.
The only documented restrictions, that I found are that
@Async is not compatible with @AspCompat and Transaction attributes (from @ Page directive  MSDN article). In other words, 
Asynchronous pages do not work when the AspCompat attribute is set to true or the Transactionattribute is set to a value other than Disabled in the @ Page directive

From our tests we conclude, that adding Async=true to the page is quite safe, even if you don't always call Async tasks from the page 
Posted on Sunday, September 30, 2012 11:55 AM ASP.NET | Back to top

Comments on this post: Adding Async=true to the page- no side effects noticed.

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Michael Freidgeim | Powered by: