I am trying to use the functionality provided by \"async\" & \"await\" to asynchronously download webpage content and I have into issues where the Tasks are waiting forever
+1 Stephen Cleary. Just came to know you need to have async before void type with Page_Load as given below:
protected async void Page_Load(object sender, EventArgs e)
{
var tasks = websites.Select(GenerateSomeContent);
await Task.WhenAll(tasks);
}
And then in your code-behind file (in case asp.net web form app) should also have Async="true" attribute.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Async="true" Inherits="EmptyWebForm._default" %>
Hope this helps visitors.