User-2060576634 posted
Hi everyone.. I currently have a textbox input that receives numbers from users but with commas.. for example: 10,000,000
it seems obvious that I couldn't validate this input to make sure it's a numeral using the validation helper . so I decided to first trim the commas out of the input using:
var myinput="";
myinput= new String(Request.Form["myinput"].Where(Char.IsLetterOrDigit).ToArray());
and then do some manual validation like:
int res;
if (int.TryParse(myinput, out res))
{
}
else
{
Response.Redirect("~/");
}
now I was wondering whether the procedure above is good practice for validating and how can I validate larger numerals rather than being limited to int?