Validation Control

prav_roy

Well-known member
Joined
Sep 10, 2005
Messages
70
Location
Mumbai
Programming Experience
1-3
hi,
i want to validate the text entered into the textbox is integer or not..if not integer then i want to display an error.. how can i carry out this using custom validation.. or can i make use of any other validation controls for this pupose..

thank you
 
You have two choices: 1st is to check out the control on server-side through vb.net code and 2nd on client-side with javaScript (or with other words using validators). Now i suppose you have an idea what is what and i am waiting for your feedback cuz i need it to know what is your choice in order to give you an adequate suggestion.

Regards ;)
 
Validating integer

Check this out (i think if is helpful in your case althrough i am not fully positive):
VB.NET:
<asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" 
ErrorMessage="not valid value (integer only allowed)" 
ValidationExpression="(^([0-9]*|\d*\d{1}?\d*)$)" ControlToValidate="TextBox1">
</asp:RegularExpressionValidator>

Regards ;)
 
Last edited:
hi,
if i want to enter characters like a-z and A-Z then what changes i have to make.. i tried with [a-z],[A-Z] but it doesnt work..
 
Back
Top