我有以下情况:
在 Default.aspx.cs
void Button1_Click(Object Sender, EventArgs e)
{
new Thread(() =>LongProcessFunction()).Start();
// I am running this function in a new thread so the end user does not wait till the end of the process
}
public void LongProcessFunction()
{
//some code with long process
// When done alert the user no matter what he's doing on the website.
System.Web.UI.ScriptManager.RegisterStartupScript(this, GetType(), "Alert","alert('Function is Complete')" , true);
}
问题是我需要这个警报脚本来显示给最终用户。我假设它在另一个线程上运行并且没有显示。