Try this code...
public class Validation
{
public bool ValidEmail(string mailId)
{
Regex reg = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
if (reg.IsMatch(mailId))
{
return true;
}
return false;
}
public bool ValidNumber(string num)
{
Regex regex = new Regex("^[0-9]*$");
if (regex.IsMatch(num))
{
return true;
}
return false;
}
}
if(!Validation.ValidEmail(txtEmail.Text))<br />
{<br />
<br />
}<br />
<br />
<br />
if(!Validation.ValidNumber(txtnumber.Text))<br />
{<br />
}