创建新用户时 ASP .NET 成员资格自定义错误消息?

发布于 2024-12-26 02:26:47 字数 920 浏览 2 评论 0原文

<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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

日记撕了你也走了 2025-01-02 02:26:47

您可以使用 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}$"

望她远 2025-01-02 02:26:47

尝试更改 CreateUserWizard 控件中的 InvalidPasswordErrorMessage

Try changing the InvalidPasswordErrorMessage in the CreateUserWizard control.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文