Redigera

Dela via


MembershipProvider.GetUserNameByEmail(String) Method

Definition

Gets the user name associated with the specified email address.

public:
 abstract System::String ^ GetUserNameByEmail(System::String ^ email);
public abstract string GetUserNameByEmail (string email);
abstract member GetUserNameByEmail : string -> string
Public MustOverride Function GetUserNameByEmail (email As String) As String

Parameters

email
String

The email address to search for.

Returns

The user name associated with the specified email address. If no match is found, return null.

Examples

For an example of a MembershipProvider implementation, see Implementing a Profile Provider.

Remarks

Takes, as input, an email address and returns the first user name from the data source where the email address matches the supplied email parameter value.

If no user name is found with a matching email address, null is returned.

If multiple user names are found that match a particular email address, only the first user name found should be returned. You can implement a custom mechanism for ensuring a unique email address for each user name such as the RequiresUniqueEmail property supported by the SqlMembershipProvider provider.

Applies to

See also