9

Is there a way to reload the browser page from within Silverlight? i.e. have the same effect as a user clicking the reload button?

Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
  • I prefer adding parameter to url query: http://stackoverflow.com/questions/1722615/forcing-browsers-to-reload-silverlight-xap-after-an-update – Rover Aug 06 '12 at 13:55

6 Answers6

14

I've always used:

namespace for refresh page :

using System.Windows.Browser;

code: give this code inside ur button click..

HtmlPage.Document.Submit();
Community
  • 1
  • 1
Dan Auclair
  • 3,607
  • 25
  • 32
7

You could try this::-

 HtmlPage.Window.Navigate(HtmlPage.Document.DocumentUri);
AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306
3

Yes. You can use the NavigationService.Refresh method to reload the page.

Rune Grimstad
  • 35,612
  • 10
  • 61
  • 76
2

http://www.divelements.com/silverlight/tools.aspx

Refer to the link above.

Use:

htmlHost.Document.Submit();
musefan
  • 47,875
  • 21
  • 135
  • 185
0

In the html or aspx page hosting your silverlight xap file write this function in javascript

function refreshPage() {
   window.location.href = window.location.href + "?updated";
}

From inside your silverlight app, write the below piece of code to refresh the app without giving the user and impression that the page refreshed (considering the xap file is cached and it refreshes right away)

HtmlPage.Window.Invoke("refreshPage");
Taha Rehman Siddiqui
  • 2,441
  • 5
  • 32
  • 58
0

I use

System.Windows.Browser.HtmlPage.Document.Submit();