【问题标题】:How do I redirect the asp.net page that contains a silverlight app from within the silverlight app?如何从 silverlight 应用程序中重定向包含 silverlight 应用程序的 asp.net 页面?
【发布时间】:2014-01-23 15:35:08
【问题描述】:

我有一个多视图:view1 包含一个按钮,view2 包含 silverlight 应用程序 - 基本上是一个按钮。

在 view1 中按下 asp:button 将带您进入 view2 并激活 silverlight 应用程序。

如何让点击 Silverlight 应用程序中的按钮返回 view1。

我尝试使用启用了 aspnetcompatibility 的 WCF 服务,但由于 httpcontext.current.response 为空,因此没有产生结果。

也许我应该使用 httphandler?

我想知道是否有人可以指导我正确的方向。

谢谢。

【问题讨论】:

    标签: c# asp.net .net wcf silverlight


    【解决方案1】:

    您可以在 Silverlight 托管页面中编写一个 javascript 方法,然后您可以使用

    调用 JS 方法
    HtmlPage.Window.Invoke("YourJSMethod", parameter);
    

    YourJSMethod() javascript 方法中,您可以编写逻辑来加载视图 1。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多