Hi @Ruwan Ratnayake ,
You can study this document, which contains detailed steps to implement asynchronous web forms.
https://zcusa.951200.xyz/en-us/aspnet/web-forms/overview/performance-and-caching/using-asynchronous-methods-in-aspnet-45#CreatingAsynchGizmos
ASP.NET asynchronous pages must include the Page directive with the Async
attribute set to "true"
.
I wrote a simple example, you can refer to:
]1
private async Task GetGizmosSvcAsync()
{
Label1.Text = "Test";
}
protected void Button1_Click(object sender, EventArgs e)
{
RegisterAsyncTask(new PageAsyncTask(GetGizmosSvcAsync));
}
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.