AspDotNetAtoms.com provides daily updates on ASP.NET Tutorials, Programming Resources, .NET Articles, Authors and more.

Categories

Recent Posts

Executing async task in asp.net : Andrea Colaci

Wednesday, October 01 2008

This article explores different ways to deal with long running tasks in Asp.net, leveraging PageAsyncTask and Asyncronous Delegates. If such a task must be initiated from an Asp.net web page, the thread that is serving the page request is bound to the task until it completes or a timeout occurs. Asp.net and .net framework offer different ways to address this issue, in the project used for this article, a sample page attempts to star a long running task in three different ways: 1. Synchronously simply starting the task and waiting for its completion 2. Asynchronously, using Page.RegisterAsyncTask and other features 3. Asynchronously, using asynchronous delegates Each of these options have pro and cons, and fit in different scenarios, but also these options don't require to include the Async="true" attribute in the page's @ Page directive. The first option entails to keep busy the thread that is serving the request, until the task completes. This could be a bottleneck, especially if multiple users start multiple tasks. This condition will probably end up to a 503 "Server Unavailable" error.

Read More:
Executing async task in asp.net : Andrea Colaci
Also See:
ASP.NET 2.0 - Safely Compile And Execute Source Code Dynamically : Robbe Morris
Cross-Site Scripting in ASP.NET : SandeepReddy Pasham
Look What You Can Do with Silverlight 2 (Part 4 of 6): Web Services Support : ASP.NET Webcasts
File Denial : Steve C. Orr

Post your comment

Comment