Friday, 20 July 2012

regular expression validator in asp.net for phone number

Here the example

<asp:TextBox ID="Phone1" runat="server" Width="90%" Height="30px"></asp:TextBox>

 <asp:RegularExpressionValidator ID="RegularExpressionValidator16" runat="server" ControlToValidate="Phone1"  Display="Dynamic"                                          ValidationExpression="^[+]?\d{9,12}$" ErrorMessage="Invalid"></asp:RegularExpressionValidator>

No comments:

Post a Comment