I am sending emails asynchronous using ASP.NET. I noticed that I have to set "Async = true" in the View.
The master page doesn't support this property. How can I set Async for all pages?
You can set it in the master page like this. Found solution here:
public abstract class MyBasePage : System.Web.UI.Page
{
public MyBasePage()
{
this.AsyncMode = true;
}
}
Then change the inheritance in the aspx.cs file to something like this:
public partial class WebForm1 : MyBasePage
It can break the system when you set the AsyncMode
property in anything else then the constructor.
Open the find dialog and enter:
Find: @Page
Replace with: @Page Async="True"
Click the Replace All button :-D To my understanding, you can't just do that automatically for everything. It needs to be defined on each and every page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With