0

hi Friend i have a problem to create user through Membership provider
I Wrote

try
{
    Membership.CreateUser(txtbox1.Text, txtbox2.Text);
    Response.Redirect("AHome.aspx");
}
catch (Exception ex)
{
    Response.Write(ex.Message);
}

and I got
"The password-answer supplied is invalid. Exception"

Please Help Me......

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by paresh_thummar
0

I guess you the provider has enable question-answer which require you to provide that information during user creation as well. Go to web.config and disable that feature by setting requiresQuestionAndAnswer="false"

<membership>
      <providers>
        <clear />
        <add name="AspNetSqlMembershipProvider"
             type="System.Web.Security.SqlMembershipProvider, System.Web,&#xD;&#xA;             Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

             connectionStringName="ApplicationServices"
             enablePasswordRetrieval="false"
             enablePasswordReset="true"
             requiresQuestionAndAnswer="false"
             requiresUniqueEmail="true"
             passwordFormat="Hashed"
             minRequiredNonalphanumericCharacters="0"
             minRequiredPasswordLength="3"
             maxInvalidPasswordAttempts="3"
             passwordAttemptWindow="15"/>
      </providers>
    </membership>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.