Membership.CreateUser 问题
这里报告了一个问题 ASP.NET 会员注册问题总结了我遇到的情况。 我不确定我是否理解所声称的解决方案。
简而言之,在调用此行后:
MembershipUser user = Membership.CreateUser(username, password, email, question, answer, true, out status);
我遇到了一种情况,其中
status != MembershipCreateStatus.Success || user == null
条目已添加到表中:aspnet Users 和 aspnet Membership。
这是我的 web.config 中的内容
passwordStrengthRegularExpression="" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0"
有人可以启发我如何重现此问题,以便我可以修复代码中的相关问题吗?
There is an issue reported here
ASP.NET Membership Issues With Registration which summarizes a situation I am experiencing. I'm not sure I understand the claimed solution.
Simply put, after invoking this line:
MembershipUser user = Membership.CreateUser(username, password, email, question, answer, true, out status);
I run into a situation where
status != MembershipCreateStatus.Success || user == null
yet entries are added to the tables: aspnet Users and aspnet Membership.
Here is what I have in my web.config
passwordStrengthRegularExpression="" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0"
Can someone enlighten me on how to reproduce this issue so that I can fix the related issue in my code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的 MembershipCreateStatus.Success 为 != 成功,那么您是否检查了其他枚举值,看看其中之一是否为您提供了更多线索:
DuplicateUserName、DuplicateEmail、InvalidPassword、InvalidEmail、InvalidAnswer、InvalidQuestion、InvalidUserName、ProviderError、UserRejected
If your MembershipCreateStatus.Success is != to success then have you checked the other enumeration values to see if one of them give you more of a clue:
DuplicateUserName, DuplicateEmail, InvalidPassword, InvalidEmail, InvalidAnswer, InvalidQuestion, InvalidUserName, ProviderError, UserRejected