2

I have one page with WebBrowser control in it. When I Navigate with NavigationService.Navigate() (next page xaml) and then back the WebBrowser control loses his web state.

How can I make the WebBrowser control not unload when navigate to other page? The solution can be put the WebBrowser control outside. I saw there is something in c#/silverlight called AdornerLayer.

Please advice/help. Thanks.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Ishai
  • 169
  • 10
  • Hi Ishai, haven`t tried it, but try to use the PhoneApplicationService.State Dictionary to store the webbrowser state when you navigate from it and load the state if you navigate back to it. – cordellcp3 Apr 06 '11 at 05:51
  • Thanks But unfortunately it's not enough for me, I don't want even reload the web page. – Ishai Apr 10 '11 at 04:45

1 Answers1

1

If the web site is under your control, then you could use cookies to store whatever state you have, and then re-load it when the user returns. If not, and you just want to store which page the user was viewing before, then you can store the URL in PhoneApplicationPage.State and then restore it in the OnNavigatedTo override for the page.

Derek Lakin
  • 16,179
  • 36
  • 51
  • Thanks But unfortunately it's not enough for me, I don't want even reload the web page. – Ishai Apr 10 '11 at 04:45
  • If you're navigating forwards to a page, and then backwards to this page with the WebBrowser control on it, the only option you have is to reload the web page. There is no way for you to cache application pages in the navigation history. – Derek Lakin Apr 10 '11 at 12:52