asp.net ajax updatepanel 和播放声音

发布于 2024-07-13 18:02:36 字数 67 浏览 5 评论 0原文

我想在 asp.net updatepanel 更新时播放声音。 ajax面板更新时有没有免费且简单的方法来播放声音?

I want to play a sound when asp.net updatepanel updates. Is there a free and simple way to play sound when ajax panel updates?

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

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

发布评论

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

评论(1

黎歌 2024-07-20 18:02:36

您必须将一个事件附加到 endRequest 事件:

Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(EndRequestHandler);

上面是 Asp.Net ajax,您必须解析并确定回发是否来自 updatepanel 的更新。 获得跨浏览器兼容的声音播放的唯一真正方法是在 Flash 对象内触发它。 IE 和 FF 有不同的发出声音的方法。

Your going to have to attach an event to the endRequest event:

Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(EndRequestHandler);

the above is Asp.Net ajax, you will have to parse and determine if the postback is coming from a updatepanel's update. The only true way to get a sound to play that is cross browser compatible is to trigger it within a Flash object. IE and FF have different methods for firing a sound.

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