Using an
UpdateProgress
control is the correct option if your page is an Asp.net Ajax enabled page (With
UpdatePanel
). But, what if you don't use
UpdatePanel
?
How about a quick easily solution as follows?
protected void Page_Load(object sender, EventArgs e)
{
Response.BufferOutput = false;
Response.Write(new string(' ', 256));
Response.Write("Processing...<br />");
Response.Flush();
Thread.Sleep(5000);
Response.Write("<br />Done.");
Response.Flush();
}
When you hit the page in the browser, the "Processing..." will be shown first and after 5 seconds the "Done" message will be shown without any page refresh. The 5 seconds delay is caused due to the
Thread.Sleep(5000)
and you call your database method here.
Enjoy!