哪个控件导致了回发?
我有两个按钮:
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:Button ID="Button2" runat="server" Text="Button" />
如何在 pageLoad 上确定这两个按钮中的哪一个导致了回发? 是否有一个简短的解决方案,因为我知道只有两个控件可以导致此回发?
I have two buttons:
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:Button ID="Button2" runat="server" Text="Button" />
How can I determine on pageLoad which one of this two caused the postback?
Is there a short solution as I know there are only two controls that can cause this postback?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以使用此方法来获取导致回发的控件:
You can use this method to get the control that caused the postback:
http://geekswithblogs.net/mahesh/archive/2006/06/ 27/83264.aspx
http://geekswithblogs.net/mahesh/archive/2006/06/27/83264.aspx
这有助于找到导致页面加载回发的控件名称。这对我有帮助。希望这对其他人也有帮助
This helps to find the name of control that caused postback in pageload.This helped me.Hope this helps someone else too
添加到此:您可以通过以下方式找到导致回发的事件:
To add to this: you can find which event caused the postback with: