I am trying to use the WebClient Class inside a Visual Web Part (via a User Control code behind class). When I want to run the web part I always get:
Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event.
How can I avoid this. I know that I can set the async property to true on a normal ASP.NET page. But how can I achieve this inside SharePoint 2010.