Reputation: 49
I need to format many text boxes in my C# web application some to accept 13 numbers some to accept 10 numbers and some to accept a combination like "IS112" I haven't been able to find anything that wasnt a masked text box using AJAX Extensions and am just checking to see if there is any way before I have to add the extension and remake and ID my text boxes.
Upvotes: 3
Views: 883
Reputation: 322
<asp:TextBox ID="txtBox" runat="server" MaxLength="13"></asp:TextBox>
This is a text Box
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"runat="server" ControlToValidate="txtBox"
ValidationExpression="^(\d{0,13})$" ErrorMessage="*Invalid Text Length:" text="*" Display="Dynamic" />
Upvotes: 2