I have an ASP.MVC application which has a silverlight app inside. I want to change the page when I click one of my buttons. Is there a way to make it?
views:
33answers:
2
+2
A:
I think the HtmlPage.Navigate method is probably what you're looking for.
You'll need the following using statement:
using System.Windows.Browser;
HtmlPage.Window.Navigate(new Uri("http://www.mypage.com/newPage.html"));
Just stick this guy in the click event of your button and it should do what you want.
Also, if you wish to navigate within your website, you can use a Relative URI, like so:
HtmlPage.Window.Navigate(new Uri("newPage.html", UriKind.Relative));
Overhed
2010-07-01 19:49:20
My VS is complaining that this Navigate method doesnt exist.
Bruno
2010-07-01 19:58:04
A:
What should be done is to use the using System.Windows.Browser;
statement, and the, in the click method, add the following code:
HtmlPage.Window.Navigate(new Uri("http://yourpagegoeshere.com"));
Thanks overhed!
Bruno
2010-07-01 20:12:15
I was just about to edit my post. :)It looks like they changed this class a bit since the last time I used it.
Overhed
2010-07-01 20:18:09