将事件处理程序附加到事件 OnInit 或 OnLoad
你好 在面试网站上发现这个问题 给定 ASP .Net Page 类的以下方法,您将在其中哪个方法中将事件处理程序附加到网页上的控件发布的事件? a) 加载() b) Page_Loader() c) OnInit() d) OnPostBack()
无法在OnLoad 和OnInit 之间做出选择。谁能给我解释一下吗?
Hi
Found this question on an interview site
Given the following methods of the ASP .Net Page class, in which of them would you attach an event handler to an event published by a control on the web page?
a) OnLoad()
b) Page_Loader()
c) OnInit()
d) OnPostBack()
Can't decide between OnLoad and OnInit. Can anyone explain it to me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这似乎不是一个很好的面试问题。虽然 OnInit 和 OnLoad 之间存在差异,但它们都不适用于将事件处理程序附加到事件。
That doesn't seem like a very good interview question. While there are differences between OnInit and OnLoad, none of them apply to attaching an event handler to an event.