[02/03] use Validator Control in asp.net
I have a textbox(this textbox is required and must be numeric). I want to use regular expression validator to validate it.
I set ValidationExpression="\d{1,10}", but it allow blank field(not allow numeric). How can I don if i want a textbox(required and must be numeric)? I do not want to use two validator controls
Re: [02/03] use Validator Control in asp.net
Why not use two? You can set their positions to be dynamic so that they appear to be just one * in place when the user hasn't filled the value in.
Re: [02/03] use Validator Control in asp.net
Both regular expression validators and range validators succeed if a textbox is empty so as far as I'm aware you will have to also use a requiredFieldValidator.
I do this and do not have a problem with it.
If you're really against using 2 validators you could make your own control such as a requiredRegularExpressionValidator.