asp:RegularExpressionValidator无效 [英] asp:RegularExpressionValidator not working

查看:70
本文介绍了asp:RegularExpressionValidator无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的代码中使用此验证器时:

When I use this validator in my code:

< asp:RegularExpressionValidator id =" country_validation {生成-ID()}" RUNAT = QUOT;服务器"的ControlToValidate = QUOT; COUNTRYCODE" ErrorMessage ="输入有效的国家/地区代码,例如CA,US,PR,UK。"  ValidationExpression =" CA | US | PR | UK">

     < / asp:RegularExpressionValidator>

<asp:RegularExpressionValidator id="country_validation{generate-id()}" runat="server" ControlToValidate="countrycode" ErrorMessage="Enter a valid country code e.g. CA, US, PR, UK."  ValidationExpression="CA|US|PR|UK">
     </asp:RegularExpressionValidator>

"Country""字段 将替换为数据库中的Null值。如果我删除验证器,则TextBox中的值为"countrycode"。存储在字段中。我做错了什么?

the "Country" field is replaced by a Null value in the database. If I remove the validator the value in TextBox "countrycode" is stored in the field. What am I doing wrong?

Thx提前...... Vlad

Thx in advance....Vlad

推荐答案

错误在你的逻辑中,而不是在验证器中。

The error is in your logic, not in the validator for sure.

发布你的逻辑,我们也许可以帮助你。

Post your logic and we might be able to help you.

此外, ASP.NET论坛位于:http://forums.asp.net/您将获得有关ASP.NET相关问题的更好帮助。

Also, the ASP.NET forums are located here: http://forums.asp.net/ you'll get better help on ASP.NET related questions there.


这篇关于asp:RegularExpressionValidator无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆