This topic has not yet been rated - Rate this topic

UserValidatedEventArgs.UserName Property

Gets the user name of the validated user.

Namespace:  System.Web.ClientServices.Providers
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)
'Declaration
Public ReadOnly Property UserName As String
'Usage
Dim instance As UserValidatedEventArgs 
Dim value As String 

value = instance.UserName

Property Value

Type: System.String
The user name of the validated user.

The following example code demonstrates how to use this property to display the user name in the title bar of a form.

Private WithEvents formsMembershipProvider As  _
    ClientFormsAuthenticationMembershipProvider = _
    System.Web.Security.Membership.Provider

Private appName As String = "ClientAppServicesDemo" 

Private Sub Form1_UserValidated(ByVal sender As Object, _
    ByVal e As UserValidatedEventArgs) _
    Handles formsMembershipProvider.UserValidated

    ' Set the form's title bar to the application name and the user name. 
    Me.Text = String.Format("{0} ({1})", appName, e.UserName)

End Sub

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.