更新时间:2023-02-05 20:39:40
我遇到了类似的问题,但是,我根本不想为 LinkButtons 触发 onbeforeunload,因此我对 .aspx 上的每个 LinkButton 使用了以下内容页面:
I had a similar problem, however, I didn't want to fire onbeforeunload for LinkButtons at all, therefore I used the following for every LinkButton on the .aspx page:
OnClientClick="eval(this.href);return false"
LinkButtons 的功能并没有被削弱,因为它们所做的只是提供一个带有 CommandArgument 的 Command 以供代码隐藏处理......
Functionality of the LinkButtons wasn't crippled, since all they did was supplying a Command with CommandArgument for the codebehind to handle...