创建新用户时 ASP .NET 成员资格自定义错误消息?
<add name="MyMembershipProvider"
type="BlueDDApp.Controllers.MyMembershipProvider"
connectionStringName="ApplicationServices"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="8"
minRequiredNonalphanumericCharacters="0"
passwordStrengthRegularExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!%,.;:])|(?=.*[a-z])(?=.*[0-9])(?=.*[!%,.;:])|(?=.*[A-Z])(?=.*[0-9])(?=.*[!%,.;:])$"
passwordAttemptWindow="10"
applicationName="/" />
是否有像 errorMessageMInPasswordLength="custom erroe message"
这样的属性,以便我可以在输入密码时轻松设置自定义消息length<8
使用网站管理工具,它提供了一个类似向导的界面来创建新用户。 (要启动此工具,请单击 Microsoft Visual Studio 中网站菜单上的 ASP.NET 配置)
<add name="MyMembershipProvider"
type="BlueDDApp.Controllers.MyMembershipProvider"
connectionStringName="ApplicationServices"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="8"
minRequiredNonalphanumericCharacters="0"
passwordStrengthRegularExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!%,.;:])|(?=.*[a-z])(?=.*[0-9])(?=.*[!%,.;:])|(?=.*[A-Z])(?=.*[0-9])(?=.*[!%,.;:])$"
passwordAttemptWindow="10"
applicationName="/" />
Is there any attribute like errorMessageMInPasswordLength="custom erroe message"
so that i can easily set custom message when entered password length<8
Used the Web Site Administration Tool, which provides a wizard-like interface for creating new users. (To start this tool, click ASP.NET Configuration on the Website menu in the Microsoft Visual Studio)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
passwordStrengthRegularExpression
中的正则表达式强制长度。例如,字母字符的长度仅在 8 到 16 个字符之间:
"^[a-zA-Z]{8,16}$"
You can enforce length with a regular expression in
passwordStrengthRegularExpression
.For example, alphabetic chars only between 8 and 16 chars in length :
"^[a-zA-Z]{8,16}$"
尝试更改
CreateUserWizard
控件中的InvalidPasswordErrorMessage
。Try changing the
InvalidPasswordErrorMessage
in theCreateUserWizard
control.