Norque
Norque

Reputation: 49

Can you Format input from a text box in C# without a masked text box?

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

Answers (1)

AGrammerPro
AGrammerPro

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

Related Questions