.Net RIA 服务:Javascript 回调强制完全重新加载应用程序

发布于 2024-08-23 02:59:35 字数 466 浏览 7 评论 0原文

我已经成功地实现了来自 Silverlight 的 Javascript 调用(我正在调用 java applet)。 当用户使用完小程序后,我想将数据发送回Silverlight; 所以我创建了一个回调函数:

    [ScriptableMember]
    public void DoCallback(string svalue)
    {
        MessageBox.Show(s, "Value from Applet:", MessageBoxButton.OK);
    }

一切正常,直到 DoCallback() 函数结束 - 由于某种原因,整个 Silverlight 应用程序关闭,并且 App.xaml.cs 从头开始​​加载。

该功能在子视图中实现:~/View/Applet.xaml。 我想不知何故应用程序没有获取 URI 的 /#/Applet 参数,这就是它强制完全重新加载的原因。

I've successfully implemented a Javascript call from Silverlight (i'm calling a java applet).
When the user finishes using the applet, I'd like to send the data back to Silverlight;
so I've created a callback function:

    [ScriptableMember]
    public void DoCallback(string svalue)
    {
        MessageBox.Show(s, "Value from Applet:", MessageBoxButton.OK);
    }

Everything works fine, until the DoCallback() function ends - here for some reason the whole Silverlight application shuts down, and App.xaml.cs loads up from the beginning.

The function is implemented in a sub-View: ~/View/Applet.xaml.
I guess somehow the application don't get the /#/Applet parameter for the URI, that's why it forces a full reload..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅浅淡淡 2024-08-30 02:59:35

...在 Silverlight 项目中切勿使用 html button 代替 input[@type="button"],因为它始终会像 input[@type="submit"] 一样提交。

...never use the html button instead of input[@type="button"] in a Silverlight project, because it will always submit like input[@type="submit"].

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文