RegularExpressionValidator
RegularExpressionValidator control on TextBox,
[0-9]{0,5}
1) it only allows digits.
2) its length can be upto 5.
In short, v can enter only numeric in text box upto length 5.
Like "87564", "12345ssd" - Valid.
"12k", "4abcd","1234s"- Invalid.
This is how it works of.
But when i try it using coding like..
string strData="5abcd";
if(System.Text.RegularExpressions.Regex.IsMatch(strData, "[0-9]{0,5}"))
{
MessageBox.Show("Valid");
}
else
{
MessageBox.Show("Invalid");
}
This returns Valid.
Which should not be..
Can anybody help!!