UserValidatedEventArgs UserValidatedEventArgs UserValidatedEventArgs UserValidatedEventArgs Class

Definition

Provides data for the UserValidated event.

public ref class UserValidatedEventArgs : EventArgs
public class UserValidatedEventArgs : EventArgs
type UserValidatedEventArgs = class
    inherit EventArgs
Public Class UserValidatedEventArgs
Inherits EventArgs
Inheritance
UserValidatedEventArgsUserValidatedEventArgsUserValidatedEventArgsUserValidatedEventArgs

Examples

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

private ClientFormsAuthenticationMembershipProvider formsMembershipProvider =
    (ClientFormsAuthenticationMembershipProvider)
    System.Web.Security.Membership.Provider;
private String appName = "ClientAppServicesDemo";

private void AttachUserValidatedEventHandler()
{
    formsMembershipProvider.UserValidated += 
        new EventHandler<UserValidatedEventArgs>(Form1_UserValidated);
}

private void Form1_UserValidated(object sender, UserValidatedEventArgs e)
{
    // Set the form's title bar to the application name and the user name.
    this.Text = String.Format("{0} ({1})", appName, e.UserName);
}
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

Remarks

This class provides access to the user name of the validated user through the UserName property.

For more information about how to handle events, see Handling and Raising Events.

Constructors

UserValidatedEventArgs(String) UserValidatedEventArgs(String) UserValidatedEventArgs(String) UserValidatedEventArgs(String)

Initializes a new instance of the UserValidatedEventArgs class.

Properties

UserName UserName UserName UserName

Gets the user name of the validated user.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See Also