making asynchronous calls from generic handler (.ashx)

You need to implmement IHttpAsyncHandler rather than IHttpHandler and register it as such in the web.config file. Browsers will also observe connection limits, so make sure IIS is configured properly to handle multiple connections, keep-alive, etc.

Here's a detailed walk through: http://msdn.microsoft.com/en-us/library/ms227433.aspx


In ASP.NET 4.5 is the HttpTaskAsyncHandler. You can use it like this:

public class MyHandler : HttpTaskAsyncHandler {

    public override async Task ProcessRequestAsync(HttpContext context) {
       await WhateverAsync(context);
    }

}