Showing posts with label regular expression. Show all posts
Showing posts with label regular expression. Show all posts
Email Validation from Codebehind
Posted by : sarav
on 4:10 AM
This is for check the email address from codebehind using regular expression.
if (System.Text.RegularExpressions.Regex.IsMatch(txtNewsletter.Text, "^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{1,3})$") == false)
{
Page.RegisterStartupScript("GetType", "<script language='javascript'>alert('Please enter valid email address!')</script>'");
}
Labels: email validation, javascript, JS, regular expression 0 Comments
Subscribe to:
Posts (Atom)



Recent Comments