Asp.net正则表达式问题 [英] Asp.net regular expression problem

查看:68
本文介绍了Asp.net正则表达式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have a regular expression  like below what my goal when user changed dropdown country in that  ddl country selected index depending on the country i have setted

VatRegularExpression = sp.CountryVatRegularExpressionGet(ddlCountry.SelectedValue)  ---here i  am getting regular expression from database

If Not String.IsNullOrEmpty(VatRegularExpression) Then
RegtxtVatCode.Enabled = True
RegtxtVatCode.ValidationExpression = VatRegularExpression
End If

<asp:RegularExpressionValidator ID="RegtxtVatCode" Enabled="false"
runat="server" ControlToValidate="txtVatCode" Display="Dynamic" CssClass="help-block"
ErrorMessage="<%$ Resources: res, WrongVatCode %>">
</asp:RegularExpressionValidator>

But my problem is when there is no VatRegularExpression value. for example when i select country germany there is no regular expression for this country.then also still it is giving the error message but it should not give the error message.Can you help me out please





我尝试了什么:



i尝试了很多不能正常工作的事情



What I have tried:

i have tried many things not working

推荐答案

资源:res,WrongVatCode%>>
< / asp:RegularExpressionValidator>

但我的问题是在那里是没有VatRegularExpression值。例如,当我选择国家德国时,这个国家没有正则表达式。然后它仍然给出错误信息,但它不应该给出错误信息。请你帮我出去
Resources: res, WrongVatCode %>"> </asp:RegularExpressionValidator> But my problem is when there is no VatRegularExpression value. for example when i select country germany there is no regular expression for this country.then also still it is giving the error message but it should not give the error message.Can you help me out please





我尝试了什么:



i尝试了很多东西不工作



What I have tried:

i have tried many things not working


这篇关于Asp.net正则表达式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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