i was learning how to use Async and Await c#. so i got a link http://msdn.microsoft.com/en-us/library/vstudio/hh191443.aspx#BKMK_WhatHappensUnderstandinganAsyncMethod
from here i try to run the code from VS2012 IDE but getting error. this function is raising error.
private void button1_Click(object sender, EventArgs e)
{
int contentLength = await AccessTheWebAsync();
label1.Text= String.Format("\r\nLength of the downloaded string: {0}.\r\n", contentLength);
}
this line giving error await AccessTheWebAsync();
The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'
what i am doing the wrong. please guide me how to run the code. thanks