关于正则表达式验证器

关于正则表达式验证器

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

问题描述

先生/女士,您好... !!!


在薪资字段"中,范围必须为10000到50000.

如何设置正则表达式??????

请帮帮我... !!!!

ThankQ.

Hi Sir/ Madam....!!!


In Salary Field , the range must be 10000 to 50000.

How to set regular expression???

please Help Me Out...!!!!

ThankQ.

推荐答案

<asp:textbox id="txtEmailAddress" runat="server" width="200px" cssclass="textBoxStyle" xmlns:asp="#unknown">
                             Height="20px"></asp:textbox>
                         <asp:regularexpressionvalidator id="RevEmailAddress" runat="server" errormessage="*" xmlns:asp="#unknown">
                             ValidationGroup="SignUp" ControlToValidate="txtEmailAddress" ValidationExpression="\w+([-+.'']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:regularexpressionvalidator>



您必须根据需要更改 ValidationExpression 属性值,就像您需要为Salary设置值一样.

还有一个认为您想要设置范围验证,那么您就必须使用范围验证器控件

即示例



you have to change ValidationExpression Attribute value as per your need like in your case you have to set it for Salary.

one more think the you want to Set the range validation then you bust have to use range validator control

i.e Example

<asp:rangevalidator id="RangeValidator1" runat="server" errormessage="RangeValidator" maximumvalue="50000" minimumvalue="10000" xmlns:asp="#unknown"></asp:rangevalidator>



希望这会对您有所帮助:)



Hope this will helps you:)



这篇关于关于正则表达式验证器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 13:19