Saturday, 21 July 2012

Email Validation in the C# code behind


  string pattern=@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";
                System.Text.RegularExpressions.Match match =
                     Regex.Match(txtEmail.Text.Trim(), pattern, RegexOptions.IgnoreCase);

                if (match.Success)
                {
                }
                else
                {
                }