ChangePassword::NewPasswordRequiredErrorMessage Property

 

Gets or sets the error message that is displayed when the user leaves the New Password text box empty.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public:
property String^ NewPasswordRequiredErrorMessage {
	virtual String^ get();
	virtual void set(String^ value);
}

Property Value

Type: System::String^

The error message to display if the user leaves the New Password text box empty. The default is "New Password is required."

The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.

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.

System_CAPS_noteNote

The new password must also meet the minimum requirements set by the in the MinRequiredPasswordLength, MinRequiredNonAlphanumericCharacters, and PasswordStrengthRegularExpression properties. If the password does not meet these requirements, the ChangePasswordError event is raised.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: