Kostya Sydoruk
Kostya Sydoruk

Reputation: 144

Invoke webservice from javascript to refresh an update panel

I'm having a hard time figuring out how to do this, Heres what I am trying to do:

I have a webpage containing statuses of users I've chose to follow(Something like facebook's statuses). Now what am trying to do is to refresh the webpage automatically so that whenever a user changes his status I won't have to refresh the webpage to see it.

The status list is a Repeater located inside an UpdatePanel, it's data source is structure of List<User> I've created(there is no DB involved). Each user has an unique ID, name and status. The users I follow is a List of strings containing the IDs of those users stored on the Session.

I have read countless articles about how to use a webservice and how to use javascript yet I remain clueless on how refresh the updatepanel's content automatically through the webservice.

Upvotes: 0

Views: 816

Answers (1)

SpruceMoose
SpruceMoose

Reputation: 10320

Good example of using a timer (for an update panel) here:

http://msdn.microsoft.com/en-us/library/cc295400.aspx

Assuming you are using JQuery you can then call a webservice from this 'Timer_Tick()' method using the following:

JQuery & Timer :: Updating the text of a hyperlink from a webservice

Upvotes: 1

Related Questions