从.xaml文件导航到.aspx文件 [英] To navigate from .xaml file to .aspx file
本文介绍了从.xaml文件导航到.aspx文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我想从同一个根网站中的银色页面浏览到.aspx页面.我在.xaml文件中使用超链接"按钮,并希望在单击该按钮时导航到.aspx文件.
请帮我.
谢谢
Hi, i want to navigate from a silver light page to a .aspx page in the same root website .I use Hyperlink button in .xaml file and want to navigate on clicking of this button to .aspx file.
Plzz help me.
Thanks
推荐答案
在您的按钮上,为MouseLeftButtonUp事件处理程序添加一个事件处理程序,然后进行导航.
只需在您的代码调用中包含System.Windows.Browser
命名空间
On your button, add an event handler for the MouseLeftButtonUp event handler and do a browers Navigate.
Just includeSystem.Windows.Browser
namespace and in your code call
HtmlPage.Navigate(MyURL);
MyURL是您的目标.这是一个静态方法,因此您可以在任何地方调用它.
where MyURL is your target. It''s a static method, so you can call it from anywhere.
使用以下代码片段:
Use the following code snippet:
System.Windows.Browser.HtmlPage.Navigate("mySecondPage.aspx");
如果此信息有帮助,请标记为答案".
Please "Mark As Answer" if this information is helpful.
这篇关于从.xaml文件导航到.aspx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文