当浏览器关闭时,我想调用webservice的web方法。怎么做。 [英] When browser is closed i want to call the web method of the webservice .. How can be done.??

查看:61
本文介绍了当浏览器关闭时,我想调用webservice的web方法。怎么做。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


有人可以告诉我如何捕获浏览器关闭事件。当

被解雇时我想调用网络方法。


提前致谢。


问候,

Gouri。

Hello,

Can anybody please tell me how to trap the browser close event. when
that is fired I want to call the web method.

Thanks in advance.

Regards,
Gouri.

推荐答案

< Go ************ @ gmail.comwrote在消息中

新闻:ff ********************************** @ w8g2000p rd .googlegroups.com ...
<Go************@gmail.comwrote in message
news:ff**********************************@w8g2000p rd.googlegroups.com...

有人可以告诉我如何捕获浏览器关闭事件。当

被解雇时我想调用web方法。
Can anybody please tell me how to trap the browser close event. when
that is fired I want to call the web method.



这是这个新闻组中一个相当常见的问题。


不幸的是,没有可靠的方法来做到这一点,因为网络服务器和客户端浏览器之间没有

永久连接。

网络服务器不知道客户端浏览器会发生什么,除非它/ b $ b收到另一个HttpRequest。


毫无疑问你将收到其他回复建议可能的解决方案与

卸载和/或beforeunload事件 - 没有一个可靠地工作...

-

Mark Rae

ASP.NET MVP
http:// www.markrae.net

This is a fairly common question in this newsgroup.

Unfortunately, there is no reliable way to do this, because there is no
permanent connection between the webserver and the client browser. The
webserver has no idea what happens on the client browser until / unless it
receives another HttpRequest.

No doubt you''ll receive other replies suggesting possible solutions with the
unload and/or beforeunload events - none of those works reliably...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


可以用som javascript来调用网络服务吗?

- -


耶稣爱你

" Mark Rae [MVP]"写道:
would it be possible with som javascript.. calling a webservice ?
--

Jesus Loves You
"Mark Rae [MVP]" wrote:

< Go ************ @ gmail.comwrote in message

news:ff ********************************** @ w8g2000p rd.googlegroups.com ...
<Go************@gmail.comwrote in message
news:ff**********************************@w8g2000p rd.googlegroups.com...

有人可以告诉我如何捕获浏览器关闭事件。当

被解雇时我想调用web方法。
Can anybody please tell me how to trap the browser close event. when
that is fired I want to call the web method.



这是这个新闻组中一个相当常见的问题。


不幸的是,没有可靠的方法来做到这一点,因为网络服务器和客户端浏览器之间没有

永久连接。

网络服务器不知道客户端浏览器会发生什么,除非它/ b $ b收到另一个HttpRequest。


毫无疑问你将收到其他回复建议可能的解决方案与

卸载和/或beforeunload事件 - 这些都没有可靠的工作...


-

Mark Rae

ASP.NET MVP
http://www.markrae.net


This is a fairly common question in this newsgroup.

Unfortunately, there is no reliable way to do this, because there is no
permanent connection between the webserver and the client browser. The
webserver has no idea what happens on the client browser until / unless it
receives another HttpRequest.

No doubt you''ll receive other replies suggesting possible solutions with the
unload and/or beforeunload events - none of those works reliably...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


Hello subtile,


是的,你可以使用身体的onbeforeunload< body onbeforeunload =" BrowerClose();"

并对网络服务进行ajax调用 http://www.asp.net/ajax/documentatio...XTutorial.aspx


这是一种常见的做法


---

WBR,

Michael Nemtsev [微软MVP] :: blog: http://spaces.live.com/laflour


对我们大多数人来说,最大的危险并不是我们的目标太高而且我们错过了b
错过了它,但它太低了我们达到了它 (c)米开朗基罗

可以使用som javascript来调用网络服务吗?

s>

s" Mark Rae [MVP] "写道:

s>
Hello subtile,

Yep, you can use onbeforeunload of the body < body onbeforeunload="BrowerClose();">
and make ajax call to the web-service http://www.asp.net/ajax/documentatio...XTutorial.aspx

it''s a common practice for this

---
WBR,
Michael Nemtsev [Microsoft MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
swould it be possible with som javascript.. calling a webservice ?
s>
s"Mark Rae [MVP]" wrote:
s>

>< Go ************ @ gmail.comwrote in message
新闻:ff ********************************** @ w8g2000 prd.googlegroups.com
。 ..
><Go************@gmail.comwrote in message
news:ff**********************************@w8g2000 prd.googlegroups.com
...

>>任何人都可以告诉我如何捕获浏览器关闭事件。当我被解雇时,我想调用web方法。
>>Can anybody please tell me how to trap the browser close event. when
that is fired I want to call the web method.


这是这个新闻组中一个相当常见的问题。

不幸的是,有没有可靠的方法来做到这一点,因为网络服务器和客户端浏览器之间没有永久的连接。
网站服务器不知道客户端浏览器会发生什么,直到/
除非收到另一个HttpRequest。

毫无疑问,您将收到其他回复,建议可能的解决方案
卸载和/或之前的事件 - 这些都不可靠......
-
Mark Rae
ASP.NET MVP
http://www.markrae.net



这篇关于当浏览器关闭时,我想调用webservice的web方法。怎么做。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆