我正在尝试制作一个有会员资格的网站。当成员试图更改他的密码问题和答案时,所有作品都会找到 execpt。我发现问题正是在这一行:
bool changeSucceeded = currentUser.ChangePasswordQuestionAndAnswer(model.Password, model.Question, model.Answer);
在ChangePasswordQuestionAndAnswer
. 我得到了例外:Specified method is not supported.
每次我尝试更改问题和答案。我在网上看到了很多东西,但都没有解决我的问题。这是我的 web.config 中的一些重要部分
<add name="ApplicationServices" connectionString="Data Source=localhost;Initial Catalog=ISAACWEBDB;Integrated Security=True" providerName="System.Data.SqlClient"/>
<membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
</providers>
</membership>
有谁知道我需要能够做到这一点的错误或缺失的东西是什么?
*编辑:我刚刚看到同样的事情发生了MemberShip.GetAllUsers()