如何创建与 UpdatePanel 一起使用的自定义 asp.net 验证器?

发布于 2024-08-14 12:09:00 字数 187 浏览 3 评论 0原文

我认为这个主题总结得很好......

我创建了自定义验证器,当我将它们放在设计模式下的页面上时,它们工作得很好。但是,如果我将它们放在用户控件中,然后尝试通过 updatepanel 将此用户控件添加到父页面,那么我的自定义验证器将不会触发。它们根本不起作用。

有人知道我必须在这里做什么吗?

.net 3.5

I think that subject summs it pretty well...

I have created my custom validators that work great when I put them on page in design mode. However if I place them in a usercontrol, and then try to add this user control to the parent page via updatepanel, then my custom validators just won't trigger. They simply don't work.

Does anyone have any clue on what I have to do here?

.net 3.5

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

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

发布评论

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

评论(1

榆西 2024-08-21 12:09:00

自定义验证器在回发时触发。

我的猜测是,使用更新面板,您不会发回,因此验证器不会触发。

Custom validators trigger on postback.

My guess is that with the update panel, you're not posting back, hence the validator not firing.

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