如何触发 WebControls OnDispose 事件?
我在我的 Page
Dispose
(覆盖但随后调用基本 Dispose
)方法和我的 OnDispose
中设置了断点处理程序。
OnDispose
处理程序永远不会被调用,但 Page
Dispose()
方法会被调用。
如果您无法调用处理程序,那么事件的意义何在?
这个问题类似于 这个问题。
I have set breakpoints in my Page
Dispose
(which overrides but then calls the base Dispose
) method and my OnDisposed
handler.
The OnDisposed
handler is never called, but the Page
Dispose()
method is.
If you can't call the handler, what's the point of having the event?
This question is similar to this question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AutoEventWireup="true" 是调用
OnDispose
所需的内容。AutoEventWireUp 页面属性意味着什么?
这是关于断点原因的一个很好的答案可能不会被击中。
何时触发 OnDispose
AutoEventWireup="true" is what you need for
OnDisposed
to be called.What does AutoEventWireUp page property mean?
Here is a nice answer on why the breakpoint might not be hit.
When OnDisposed is triggered