LinkButton 点击事件被忽略
我有以下超链接作为按钮:-
<asp:LinkButton ID="loginButton" runat="server" CssClass="loginButton" Text="LOGIN" OnClientClick="return validateLogin(memNoID,pwID)" AddressOf="loginButton.Click"></asp:LinkButton>
它会导致回发,但仅执行代码的加载和预渲染部分。它完全忽略以下函数签名:-
Protected Sub loginButton_Click(ByVal sender As Object, ByVal e As EventArgs)
Some code
End Sub
任何指针赞赏。
I have the following Hyperlink as a button:-
<asp:LinkButton ID="loginButton" runat="server" CssClass="loginButton" Text="LOGIN" OnClientClick="return validateLogin(memNoID,pwID)" AddressOf="loginButton.Click"></asp:LinkButton>
It causes a postback but only executes the onload and prerender sections of code. It totally ignores the following function signature:-
Protected Sub loginButton_Click(ByVal sender As Object, ByVal e As EventArgs)
Some code
End Sub
Any pointers appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在代码中添加 OnClick:
Add OnClick in your code:
您是否尝试将 _Click 方法添加到 OnClick 事件中?
Did you try adding your _Click method to the OnClick event?