如何在asp.net中加速RegularExpressionValidator?

时间:2011-04-20 12:07:00

标签: asp.net regex

我有一个文本框,使用RegularExpressionValidator检查字符串格式是否正确,大约需要20秒才能检查。有没有办法加快速度?

<asp:TextBox runat="server" ID="txtNumber"
    width="9 em"
    text='<%#Eval("strNumber")%>' AutoPostBack="true" 
    MaxLength="16" ontextchanged="txtNumber_TextChanged" />
<asp:RegularExpressionValidator 
    ID="NumberLength" 
    runat="server" 
    ValidationExpression="^\S{13,16}$" 
    ErrorMessage="Invalid Number" 
    Display="None" ControlToValidate="txtNumber"/>
<ajax:ValidatorCalloutExtender 
    ID="ValidatorCalloutExtender1" 
    runat="server" TargetControlID="NumberLength">
</ajax:ValidatorCalloutExtender>

0 个答案:

没有答案