使用 AJAX 滚动时未定义 ValidatorEnable

发布于 2024-07-14 11:52:20 字数 370 浏览 3 评论 0原文

我有一些网络表单,可以与各种静态和动态生成的验证器一起正常工作。

由于某种原因,现在我已经在表单上实现了 UpdatePanel,当我手动调用其中一个表单上的 ValidatorEnable() 方法时(当我单击复选框时),我收到“ValidatorEnable 未定义”错误消息。

我将相同的 clientID 等传递到我实现 AJAX.net 控件之前使用的方法中

.net 似乎没有将 /WebResource.axd?d=aUu4P3dfjWWyw3KQ9t2ZdqxnzYhrtq9uWWiRZduXE-g1 脚本渲染到页面,手动添加它我得到其他缺少的 JS 对象。 那么如何强制它注册相关脚本呢?

注意:有问题的验证器正在中继器中呈现

I have some webforms which have been working fine with various static and dynamically generated validators.

For some reason now that I have implemented UpdatePanels on the forms, when I manually call the ValidatorEnable() method on one of them (when I click a checkbox) I get the "ValidatorEnable is not defined" error message.

I am passing the same clientID etc into the method that I was using before I implemented the AJAX.net controls

It would seem .net isnt rendering the /WebResource.axd?d=aUu4P3dfjWWyw3KQ9t2ZdqxnzYhrtq9uWWiRZduXE-g1 script to the page, adding it manually I get other missing JS objects. So how can I force it to register the relevant scripts?

N.B. The validators in question are being rendered in a repeater

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

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

发布评论

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

评论(1

つ可否回来 2024-07-21 11:52:20

我发现,如果我在中继器外部的页面上放置禁用的验证器,它会正确添加相关脚本。

这是 hacky,但确实有效

。注意,这只是消除了 Javascript 错误,验证器似乎没有在页面上注册,所以无论如何 IsValid 总是 true。

I have found that if I put a disabled validator on the page outside the repeater it correctly adds the relevant scripts.

This is hacky but does actually work

N.B.This only got rid of the Javascript error, the validators don't appear to be registering on the page, so IsValid is always true no matter what.

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