Silverlight浏览器关闭事件
当用户关闭托管 Silverlight 2 应用程序的浏览器时,我需要调用一个 Web 服务来注销用户。 我知道 Application_Exit 事件,但是当我在该事件中调用我的服务时,什么也没有发生。 我认为到那时与我的服务的连接已经关闭。
我还应该使用其他事件吗?
请帮忙。
When the user closes the browser that hosts my Silverlight 2 Application I need to call a web service that would log the user out. I am aware of the Application_Exit event, however when I call my service in that event nothing happens. I presume that the connection to my service is already closed by then.
Is there another event that I should use?
Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要这样做。 Silverlight 不支持在应用程序退出时调用服务。 您需要服务自行清理,可能需要应用程序每隔几分钟/几小时通知服务以延迟清理。
指向 Silverlight 论坛和相同问题的链接
Don't do it. Calling a service at application exit is not supported by Silverlight. You need the service to clean itself up, possibly with the application telling the service every few minutes/hours as appropriate tto delay the cleanup.
Link to Silverlight Forums and the same question