问题标签 [customvalidator]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1935 浏览

javascript - 引用 CustomValidator 控件中的源代码管理

是否可以获得对自定义验证器在 javascript 中“附加”到的文本框的引用?

如果验证失败,我想在 texbox 周围放置一个红色边框。

0 投票
2 回答
4746 浏览

c# - ValidationSummary with Client Side & Server Side Validation

If you use a CustomValidator control and a ValidationSummary control within an aspx page for server side validation you can set the ErrorMessage of the validator and its Text value will appear in place and the ErrorMessage value will be displayed within the ValidationSummary control.

Nice.

Now, what if I also perform validation on the client side in javascript, is it possible to perform the same kind of validation message display as if the server side code had fired? So that the ValidationSummary would display its usual HeaderText along with your additional ErrorMessage and the CustomValidator would display its Text value (e.g. *)

I can probably fake it for client side vs. server side but it would be nice to use the existing controls if at all possible.

Thanks in advance for any ideas or suggestions

0 投票
3 回答
1261 浏览

asp.net - 不同控制事件的客户端验证

我有一个自定义验证器附加到文本框控件,如下所示

当我单击页面上的 Causevalidation="true" 按钮时,客户端脚本会触发并且验证摘要会反映错误消息,并且验证器会显示 *

但是,当我单击文本框时,验证器仅显示 * 验证摘要未更新

客户端验证正在工作,因为服务器端代码没有被调用,我只是想弄清楚为什么验证摘要没有在 onblur 事件上更新

有任何想法吗?

编辑:

ErrorMessage 在验证器的代码隐藏中设置

我已将 EnableClientScript 添加到我的验证摘要中

我已将 ValidationGroup 添加到我的验证摘要、自定义验证器、文本框和按钮中,但按钮单击的验证摘要仍然更新,但文本框 onblur 事件没有更新

0 投票
2 回答
2256 浏览

asp.net - customvalidator servervalidate 参数说明

CustomValidator 的 ServerValidate 事件有 2 个参数:source 和 args。

他们每个人都指出了什么?请对它们进行任何描述。

谢谢

0 投票
5 回答
7491 浏览

asp.net - GridView 中的 ASP.Net CustomValidator 未触发

我使用此 EditTemplate 在 UpdatePanel 中获得了 Gridview:

还有一个简单的服务器端功能:

但是在调试此代码时,无论它做什么,都不会触发服务器端功能。它似乎与gridview有关,所以我不能直接通过它的id访问控件。有什么建议么?

0 投票
2 回答
2519 浏览

asp.net - 自定义验证器不会触发

我有以下代码。当我按下保存按钮时,三个 requiredfieldvalidators 运行良好且工作正常。但是我的自定义验证器不起作用。它根本不会触发事件。我有标准文本框和验证摘要控件。是否有任何原因可能无法正常工作?

0 投票
1 回答
1061 浏览

silverlight - 类上的 Silverlight CustomValidation

如果我在类或类属性上添加 CustomValidation,我如何从代码中触发它?

0 投票
1 回答
152 浏览

asp.net - 使用现有方法验证 ASP.net 控件的推荐方法是什么?

我想知道使用现有方法调用在 asp.net 中验证用户输入的首选方法是什么。我现在已经实现了这几种方法,虽然它们都有效,但我觉得可能有更好或“最佳”的方法?

我有一个 asp.net 文本框

我还可以在表单最终填充和保存的对象上使用一些现有方法

我想知道人们如何将这些项目连接到验证控件(我假设 customValidator?)。我想避免在 JavaScript 中重写验证(以避免重复代码)。

0 投票
1 回答
1312 浏览

javascript - 在客户端使用自定义验证器?脚本错误时显示ErrorMessage?

我在 asp.net 的客户端有一个关于自定义验证器的问题?

这是我的文件上传控件和自定义验证器,用于检查上传的文件是否为 doc!!!!

这是我用于检查上传文件是否为 doc 的 javascript 函数!!!!!!

我想将错误消息放在自定义验证器中代替警报消息.. of javascript..

像其他验证器的错误消息一样..我在上面验证器的文本属性中输入了错误..请在自定义验证器属性中检查它..我想显示的错误...

我检查了与此相关的所有问题.. 但我找不到我想要的..

0 投票
4 回答
15748 浏览

wcf - WCF:找不到我在 web.config 中指定的自定义验证器 - customUserNamePasswordValidatorType - - 无法加载文件或程序集... - 帮助?

因此,我基本上已经使用 wsHttpBindings 和我的 WCF 服务通过 HTTPS 使用自定义身份验证来启动和运行所有内容。

我遇到的问题是 customUserNamePasswordValidatorType:

按照此处找到的说明,我还创建了自定义类:

错误是“无法加载文件或程序集'CustomValidator'或其依赖项之一。系统找不到指定的文件。 ”,并指的是customUserNamePasswordValidatorType的尾部 - “...,CustomValidator”。

我不认为将自定义验证器放在自己的命名空间和类中是个问题,但我看不出还有什么可以做的。

我已经尝试过在开始时使用/不使用命名空间、交换等 - 什么都没有。

希望另一双眼睛能分辨出来。

谢谢。

编辑 system.serviceModel