decimal d;
if (decimal.TryParse(txt_number.Text, out d))
{
//valid Number
// Do something with value
}
else
{
//invalid Number
lbl_error.Text = "Please enter a valid number";
return;
}
if (decimal.TryParse(txt_number.Text, out d))
{
//valid Number
// Do something with value
}
else
{
//invalid Number
lbl_error.Text = "Please enter a valid number";
return;
}
No comments:
Post a Comment