System.Web.Security.SqlMembershipProvider.GetUserNameByEmail Method

Gets the user name associated with the specified e-mail address.

Syntax

public override string GetUserNameByEmail (string email)

Parameters

email
The e-mail address to search for.

Returns

The user name associated with the specified e-mail address. If no match is found, this method returns null.

Remarks

This method is called by the System.Web.Security.Membership class with an e-mail address, which it uses to retrieve an associated user name from the SQL Server database specified in the ASP.NET application's configuration file (Web.config).

If more than one user in the membership database has the same e-mail address, the first user name encountered is returned. You can set the requiresUniqueEmail attribute to true in the application-configuration file to ensure that each e-mail address in the database is unique.

Leading and trailing spaces are trimmed from the email parameter value.

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0