Ajax Scripting (Asynchronous JavaScript XML)

Look:

  1. Take scriptmanager control.
  2. Take UpdatePanel control.
  3. Take Timer control, set 1000 in interval property.
  4. Take Label control.
  5. Place the Timer, Label in updatepane

In timer1_tick event type the following:

  1. Label1.Text=DateTime.Now.ToString();       
  2.      
  3. // Displaying pictures after 1 second :     
  4. Page_load()    
  5. {    
  6.      if (! Page.IsPostBack)    
  7.      {    
  8.           Session["a"]=0;     
  9.      }    
  10. }    
  11. //In timer1_tick event type the following :     
  12.      
  13. string[] p={"blue hills.jpg","winter.jpg","sunset.jpg"};     
  14. int b=Convert.ToInt32(Session["a"]);     
  15. Image1.ImageUrl=p[b];    
  16. b++;     
  17. if (b==3)    
  18. Session["a"]=0;     
  19. else     
  20. Session["a"]=b;