Export (0) Print
Expand All

SimpleMembershipProvider.GetUserNameByEmail Method

Returns the user name that is associated with the specified email address.

Namespace:  WebMatrix.WebData
Assembly:  WebMatrix.WebData (in WebMatrix.WebData.dll)

public override string GetUserNameByEmail(
	string email


Type: System.String
The email address to search for.

Return Value

Type: System.String
The user name that is associated with the specified email address, or null if no match is found.

If multiple user names are found that match the specified email address, the first user name is returned. You can ensure unique email addresses for each user name by setting the RequiresUniqueEmail property to true.


If the SimpleMembershipProvider class has been initialized using a call to the WebSecurity.InitializeDatabaseConnection() method, this method is not supported and will throw a NotSupportedException exception. However, if the WebSecurity.InitializeDatabaseConnection() method has not been called, and if you have configured your site to use the standard ASP.NET membership provider, this method is passed through to the standard membership provider. For more information, see the SimpleMembershipProvider class overview.

© 2015 Microsoft