[英]How do I redirect the asp.net page that contains a silverlight app from within the silverlight app?
I have a multiview: view1 contains a button and view2 contains the silverlight app - basically a button. 我有一个多视图:view1包含一个按钮,view2包含silverlight应用程序-基本上是一个按钮。
Pressing the asp:button in view1 takes you to view2 and the silverlight app is activated. 在view1中按asp:按钮可转到view2,并且激活了silverlight应用程序。
How do I make the click of the button in the silverlight app take me back to view1. 如何在Silverlight应用程序中单击按钮,将我带回到view1。
I tried to use a WCF service with aspnetcompatibility enabled but that has not yielded results since httpcontext.current.response is null. 我尝试使用启用了aspnetcompatibility的WCF服务,但由于httpcontext.current.response为null,因此未产生结果。
Maybe I should use an httphandler? 也许我应该使用httphandler?
I was wondering if someone could guide me in the right direction. 我想知道是否有人可以引导我朝正确的方向发展。
Thanks. 谢谢。
You can write a javascript method in the Silverlight hosting page and you can invoke the JS method using 您可以在Silverlight托管页面中编写javascript方法,并可以使用调用JS方法
HtmlPage.Window.Invoke("YourJSMethod", parameter);
In the YourJSMethod() javascript method you can write the logic to load the view 1 back. 在YourJSMethod() javascript方法中,您可以编写逻辑以将视图1加载回去。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.