我正在学习 asp.net 页面生命周期。 我在 MSDN 上找到一篇文章 http://msdn.microsoft.com/en-us/library/ms178472.aspx 上面写着
If the request is a postback, control event handlers are called. After that, the Validate method of all validator controls is called, which sets the IsValid property of individual validator controls and of the page.
而且文章中的图片还说validate fires after event handling。 如果这是真的,我如何在处理事件时获得验证器的状态?
最佳答案
验证器在它们的服务器端事件处理程序被触发之前被验证,你可以依赖它们中的 e.IsValid,这绝对有效,很多人一直在使用它。
关于c# - 所有验证器控件的回发事件处理程序和 Validate 方法的顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3458152/