0

I don't know what is the best way to force a browser refresh when using silverlight.

The scenario is like this:

  • We have a silverlight application hosted on IIS
  • Two users opens the same page and that page contains a grid with some records.
  • Only one of the users modify one record and save the data in the database

How can the other user see that the data has been modified unless he refreshes the page manually?

Should I implement some automatic refresh?

Thanks in advance

D_D
  • 1,019
  • 4
  • 15
  • 25

1 Answers1

0

I would think long and hard about the requirements here before you open up a can of worms. Is the grid editable? With the automatic refresh idea what happens to the user who is in the middle of an edit? Think about alternatives. Could you possilbly check whether the data has changed at the point of saving data and then provide an appropriate message to the user? If you want the data to automatically refresh you are going to get into looking at server to client notifications e.g WCF duplex calls or constant polling and refreshing of the underlying bound observablecollection

Myles J
  • 2,839
  • 3
  • 25
  • 41
  • Yes, the grid is editable and I am looking for something that triggers the refresh in other users' browsers if the data has changed... – D_D Oct 04 '11 at 09:06
  • OK well if you want to go ahead with this then I think you have two options as I previously mentioned: A) Intermittent polling of the service and refreshing of the underlying ViewModel ObservableCollection (I assume that the grid is bound to an ObservableCollection) B) Server to client notifications when the data changes e.g. WCF Duplex calls. From experience both of these will be tricky to implement. – Myles J Oct 04 '11 at 09:19