On 17 çÒÄ, 15:16, "M. Ali Qureshi" <m.ali.qure...@hotmail.comwrote:
Hi,
I have a text field, where i want the user to add only numbers. The minimum
value should be 1 and there is no limit on maximum value.
I cannot use RangeValidator, because it requires a maximum value as well.
What are you going to do with value from the textbox? If you want to
convert it to a numeric value then a RangeValidator will be good
enough, just set a maximum value to Int32.MaxValue or Int64.MaxValue
according to the required result. In that way, you also check whether
an entered value does not exceed its data type range.
But if you want a string that contains numbers only, starting from 1,
use a RegularExpressionValidator with ValidationExpression =
"[1-9]\d*"
Regards,
Mykola
http://marss.co.ua