Sunday, January 18, 2009

How To Refresh an Update Panel in Asp.net AJAX C#

Hey everyone you can use triggers to refresh update panels.I'll Show how you can use
triggers to refresh.

You can use post back events such like click,Tick ,CheckChanged to refresh an update panel .













All thing you have to do is introducing a new tag as follows.




you can use the above timer to trigger








as follows you can use tick event of a timer to refresh a page in regular intervals.















The final code looks as above .It will refresh the update panel in every 30 seconds.

protected void Timer1_Tick(object sender, EventArgs e)
{
Label1.Text = " Refreshed at: " + DateTime.Now.ToLongTimeString();
}


You can specify your code in the tick event as above


No comments: