ChangePassword.NewPasswordRegularExpressionErrorMessage Property
Assembly: System.Web (in system.web.dll)
public: virtual property String^ NewPasswordRegularExpressionErrorMessage { String^ get (); void set (String^ value); }
/** @property */ public String get_NewPasswordRegularExpressionErrorMessage () /** @property */ public void set_NewPasswordRegularExpressionErrorMessage (String value)
public function get NewPasswordRegularExpressionErrorMessage () : String public function set NewPasswordRegularExpressionErrorMessage (value : String)
Property Value
The error message shown when the password entered does not pass the regular expression defined in the NewPasswordRegularExpression. The default is Empty.Use the NewPasswordRegularExpressionErrorMessage property to inform the user that the password entered does not pass the regular expression defined in the NewPasswordRegularExpression property.
The NewPasswordRegularExpressionErrorMessage is not related to the password enforcement that can be configured at the data store level. The new password must meet the minimum requirements set by the membership provider in the MinRequiredPasswordLength, MinRequiredNonAlphanumericCharacters, and PasswordStrengthRegularExpression properties. If the password does not meet these requirements, the ChangePasswordError event is raised.
The following code example shows how to set the NewPasswordRegularExpression property to define a regular expression that checks passwords to ensure that they meet the following criteria:
-
Are greater than six characters.
-
Contain at least one digit.
-
Contain at least one special (non-alphanumeric) character.
The password requirements contained in the PasswordHintText property are displayed to the user.
If the password entered by the user does not meet the criteria, the text contained in the NewPasswordRegularExpressionErrorMessage property is displayed to the user. If a new password is not entered, the text contained in the NewPasswordRequiredErrorMessage property is displayed to the user.
Note |
|---|
| The new password must also meet the minimum requirements set by the membership provider in the MinRequiredPasswordLength, MinRequiredNonAlphanumericCharacters, and PasswordStrengthRegularExpression properties. If the password does not meet these requirements, the ChangePasswordError event is raised. |
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Reference
ChangePassword ClassChangePassword Members
System.Web.UI.WebControls Namespace
ChangePassword.NewPassword Property
ChangePassword.NewPasswordLabelText Property
ChangePassword.NewPasswordRegularExpression Property
NewPasswordRequiredErrorMessage
Other Resources
ASP.NET Login Controls OverviewCustomizing the Appearance of ASP.NET Login Controls
ASP.NET Web Server Controls Templates
How to: Display Different Information to Anonymous and Logged-in Users
Web Site Administration Tool Security Tab
Note