System.Web.Security.MembershipUser.UserName Property

Gets the logon name of the membership user.

Syntax

public virtual string UserName { get; }

Value

Documentation for this section has not yet been entered.

Remarks

A membership user's MembershipUser.UserName is used in conjunction with the membership user's password to authenticate the membership user.

The MembershipUser.UserName of a System.Web.Security.MembershipUser identifies a unique user for each application that uses System.Web.Security.Membership for authentication. An application is identified by the membership Membership.ApplicationName. The same user name can be used in multiple applications for different users. Alternatively, a single user name can be used to identify a user for multiple applications, provided the applications are configured with the same Membership.ApplicationName.

You can retrieve a System.Web.Security.MembershipUser object for a membership user by passing the user name to one of the overloads of the Membership.GetUser method, or as a member of a System.Web.Security.MembershipUserCollection returned from the Membership.GetAllUsers, Membership.FindUsersByName(string, int, int, Int32@), or Membership.FindUsersByEmail(string, int, int, Int32@) method.

You can retrieve the user name for a membership user if the e-mail address for the user is known, by using the Membership.GetUserNameByEmail(string) method.

Requirements

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