Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ProfileBase.UserName Property

Gets the user name for the profile.

Namespace:  System.Web.Profile
Assembly:  System.Web (in System.Web.dll)

public string UserName { get; }

Property Value

Type: System.String
The user name for the profile or the anonymous-user identifier assigned to the profile.

The UserName property returns either the name of the authenticated user that the profile is associated with or the anonymous user identifier assigned to the profile if the IsAnonymous property is true.

Anonymous access to the user profile is enabled using the anonymousIdentification configuration section and the allowAnonymous attribute of the add configuration element used to specify profile properties.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft