ASP.NET Security Tutorials

How to validate email address in ASP.NET

You could validate email address using the following ASP.NET code.

using System.Text.RegularExpressions;

….

// Validate the supplied email address
if( !Regex.Match(Request.Form[“email”],
@”\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*”,
RegexOptions.None).Success)
{
// Invalid email address
}

Related TutorialsHow does Impersonation work in ASP.NET
How to program the ASP.NET Membership Login control in VB.NET
How to configure access rules for Role-Based authorization in ASP.NET
How to control access for specific roles in ASP.NET
The .NET Symmetric …

Learn more