I would like to know textbox restriction for the specipic nu
I would like to know textbox restriction for the specipic numeric value in asp.net Gridview
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Vasu GadhiyaRank #7,540 · 239 reputationPosted Apr 23, 2014, 9:23 PM EDT
if (!System.Text.RegularExpressions.Regex.IsMatch(textbox.Text, "^[0-9]*$"))
----------------
or use regular expression Validator control
ControlToValidate = textbox1
ErrorMessage = only number allowed
ValidationExpression = ^[0-9]*$