Thursday, April 3, 2008

World Clock And Weather Web Part Auto Update

The CKS Bamboo World Clock and Weather Web Part does provide auto update to retrieve data from MsnWeatherProvider, thus, the clock and weather is static until you manually refresh the page.

Here I am going to add an auto update function to this webpart, which will be implementing the AJAX UpdatePanel.


First
, follow the steps in http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=3 to get Ajax ready for the master page.


Second, modify CKS.Bamboo.WorldClockAndWeather.WorldClockAndWeatherWebPart to add a timer control inside UpdatePanel.

in

private void CreateWeatherClockTable()

remark & add (you can find the following code posted on the internet)

//remove the form onSubmit wrapper
private void EnsureUpdatePanelFixups()
{
}


Add timer even handler to update UpdatePanel

private void timer_Tick(object sender, EventArgs args)
{
}

 

Last, add a custom web part property in the Tool Part and the code to save and retrieve this custom web part property accordingly.