我有这个图像asp按钮:
<asp:ImageButton ID="btnUploadCoordinates" OnClientClick="return ConfirmUploadCoordinates(); " ImageUrl="../Images/cloud-upload.png" Style="width: 30px; height: 30px;" ValidationGroup="Clear" runat="server" OnClick="btnUploadCoordinates_Click" />
单击元素时是否可以阻止回发调用?
答案 0 :(得分:0)
这个
OnClientClick="return ConfirmUploadCoordinates();
应该改为
OnClientClick="return ConfirmUploadCoordinates(event);
然后在您的Javascript代码中
function ConfirmUploadCoordinates(event) {
event.stopPropagation();
event.preventdefault();
return false;
}
或您的ConfirmUploadCoordinates函数需要做的任何事情......
HTH