如何确定哪个自定义验证器将首先触发

发布于 2024-08-21 01:14:08 字数 101 浏览 0 评论 0原文

我有两个位于同一验证组中的自定义验证器。该验证组通过一键启动。我的问题是,自定义验证器将按什么顺序触发?看起来放在 aspx 页面前面的验证器首先触发,但我不想仅仅依赖于此。有什么想法吗?

I have two custom validators that are in the same validation group. This validation group is launched by one button. My question is, in what order will the custom validators fire in? It appears that the validator that is placed earlier in the aspx page fires first, but I don't want to rely solely on this. Any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

<逆流佳人身旁 2024-08-28 01:14:08

它们将按照它们在控件树中存在的顺序触发,因为页面生命周期事件从顶部向下递归到该树。验证事件又由生命周期事件触发。

They will fire in the order they exist in the control tree, since the page lifecycle events recurse down that tree from the top. The validation event is, in turn, fired from a lifecycle event.

蹲在坟头点根烟 2024-08-28 01:14:08

我不会依赖这个。我会假设任何顺序,因为这取决于实现。例如,如果您的服务器有多个处理器或者您在 Mono 上运行它,则稍后可能会发生变化。

I would not rely on this. I would assume any order as this is implementation dependent. It may later change if your server has multiple processors or if you run it on Mono, for example.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文