Restricting numeric value in Textbox

Below code is help for you to check whether a textbox entered value is numeric character or not.

string value=textbox1.text.trim();
double Num;
bool isNum = double.TryParse(value, out Num);
if(isNum)
{
    label.text="Entered text is numeric";
}
else
{
    label1.text="Entered text is not a numeric"
}

Thanks!
Ebook Download
View all
Learn
View all