且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查用户是否实际点击了“保存"?而不是“取消"?

更新时间:2023-11-28 15:01:52

Erhm,

如果您的WebForm上有两个按钮,只需双击两个按钮. Visual Studio为您生成代码(两种方法),单击保存"时将调用一种方法,单击取消"时将调用另一种方法.

祝你好运!

爱德华
Erhm,

If you have two buttons on your WebForm, just doubleclick both of them. Visual Studio generates code for you (two methods) one method will be called when ''Save'' is clicked, the other will be called when ''Cancel'' is clicked.

Good luck!

Eduard


我不认为一旦开始,您就无法停止通过网络发布的转移.如果您使用的是FTP,那就不一样了.

要回答您的问题,只需将按钮单击处理程序添加到您的aspx页面/代码后.
I dn''t think you can''t stop a transfer via web post, once it''s started. If you were using FTP, that would be different.

To answer your question, merely add button-click handlers to your aspx page/code-behind.


ConfirmButtonExtender将是此处的快速解决方案.
ConfirmButtonExtender will be a quick solution here.