English 中文(简体)
ASP.NET 页: 1 卸载以阻止用户离开网页[复制]
原标题:ASP.NET Page_Unload to stop user from leaving page [duplicate]
  • 时间:2009-08-28 13:46:51
  •  标签:
This question already has answers here:
Closed 13 years ago.

Possible Duplicate:
Best way to detect when user leaves a web page

如果用户试图放弃这一选择(如果他们没有节省进展的改动),那么我就希望让用户选择留在目前的网页上。 我不敢肯定,我已经尝试并失败了贾瓦文。

I m hoping There is a way within the page_Unload function in ASP. NET C#代码。

希望得到任何帮助。

问题回答

。 “...... 用户离开网页时的检测最佳方式”。 这应有助于你。 你们的客户是你们的,但是,如果他们去掉,服务器永远不知道。

你们不能依靠服务器的密码来这样做。 要求到服务器收到时,时间太晚。 你们需要用javascript这样做,为前载活动提供一名活动手。 见demo,关于如何做到这一点的简单想法。

我建议 Java。 例如,如果你在作一些改动后试图离开网页,就会促使你们在SO。

我认为,最佳方式见上文tvanfosson。 您可以注入这一支架服务器,提供电文、转机等。

This is a must-have: Asp.NET page life cycle. Always keep in mind that only after all the server side work is done, the page is sent to the client.





相关问题
热门标签