views:

19

answers:

1

Using Silver 4, I have a webbrowser control that I set to a web site thru code: e.g. webBrowser.Navigate("http://stackoverflow.com/questions/ask"); This brings up a web page just fine. It works fine also when I click on a hyperlink and go to another page.

I was expecting that I could find the URL of the new page thru the LoadCompleted event. Specifically in the System.Windows.Navigation.NavigationEventArgs e parameter. However, that comes back null. The Source.AbsoluteUri on the webbrowser remains the same.

But here is the strange thing! If I go to the webbrowser pane and right click on it, a property page is displayed with the current URL.

I must be missing something...

A: 

This will be another security feature. The user may potentially navigate anywhere, including say, their online bank. Content and location of the currently navigated page is unavailable to Silverlight. Silverlight has handed over that portion of its UI to the web browser and considers it to be outside of its security sandbox.

The dialog presented using right mouse click is provided by the browser being hosted by Silverlight, Silverlight itself knows nothing of it.

AnthonyWJones
Thinking thru various scenarios, I can see how this would be necessary. Still, it would be nice. Thanks for the definitive answer.
Mark Bosley