ValidatePasswordEventArgs Class
Provides event data for the ValidatingPassword event of the MembershipProvider class.
Assembly: System.Web (in System.Web.dll)
The ValidatingPassword event is raised when the CreateUser, ChangePassword, or ResetPassword method of a membership provider is called.
You can handle the ValidatingPassword event to validate password formats and values for membership users.
You can cancel the current CreateUser, ChangePassword, or ResetPassword action by setting the Cancel property to true during the ValidatingPassword event.
If you cancel the current action by setting the Cancel property to true, you can set the FailureInformation property to an exception that describes the reason for the password-validation failure. The calling method will throw the exception that the FailureInformation property is set to. If the FailureInformation property is nullptr, the caller will throw a generic password-validation failure exception.
The following code example shows a ValidatingPassword event that validates the format of the password for the user and cancels the action if the password does not match the required format.
- AspNetHostingPermission
for using the ValidatePasswordEventArgs class in a hosted environment. Demand value: LinkDemand. Permission value: Minimal.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
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.