I created a method in my class which will determine if an input is a numeric value or not.
public static Boolean IsNumeric(string strInput)
{
try
{
int iInput = int.Parse(strInput);
return true;
}
catch
{
return false;
}
}
And I used it in my customvalidator control like this
if (txtLateAllowance.Text.Length == 0)
{
vLateAllowance.Text = "Please specify the late allowance entry of employee.";
args.IsValid = false;
return;
}
else
{
vLateAllowance.Text = "Invalid entry.";
args.IsValid = false;
return;
}
And even I input a numeric value in my entry, still I get the error message “Invalid entry”. Can anyone from this community have an idea on how am I going to solve this issue. Thanks