thanks very much for yur kind reply.
i tried adding @ but still it says
"the name error provider1 does not exists in current context ".
now i have installed Expresso. i m able to generate the expressions but i couldnot save the expression to library. and i have no idea hoe to use these expression libraries to C#.code.
i tried
using System.Text.RegularExpressions;
private void text_customer_phone_Validating(object sender, EventArgs e)
{
Regex regex = new Regex(@"\{9,13}");
if (regex.IsMatch(text_customer_phone.Text))
{
errorProvider1.SetError(text_customer_phone, String.Empty);
}
else
{
errorProvider1.SetError(text_customer_phone,
"This is not valid phone number.");
}
if (regex.IsMatch(text_customer_phone.Text))
{
errorProvider1.SetError(text_customer_phone, String.Empty);
}
else
{
errorProvider1.SetError(text_customer_phone,
"This is not valid phone");
}
}
Regards
Radhika
Enter your message below
Sign in or Join us (it's free).