I have a label, all what I want is, to display label as "name1" then wait for 5 seconds and then change it to "name2". This is how I did that
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = "name1";
System.Threading.Thread.Sleep(5000);
Label1.Text = "name2";
}
What it does is it wait's for 5 seconds in total and then display "name2". "name1" is not displaying as I wished. I tried these links,
How do I get my C# program to sleep for 50 msec?
How to trigger a timer tick programmatically?
Did not help. This Using the ASP.NET Timer Control with Multiple UpdatePanel Controls seems to work but this is keep on refreshing the page. I don't want this to happen, it should display name1 then wait for 5 seconds, display name2 and then stop.