Question

I'm building a small website which will have FBA enabled (SqlMembershipProvider) and I want signup to be as simple as possible, just a prompt for username (email address) and password.

How do I remove the security question from the create user control?

Was it helpful?

Solution

My bad, I jumped the gun on that one.

It looks like the control will sense if the underlying provider required a question and answer. So, have you tried disabling it in the web.config?

<add
  name="AspNetSqlMembershipProvider"
  type="System.Web.Security.SqlMembershipProvider, ..."
  connectionStringName="LocalSqlServer"
  enablePasswordRetrieval="false"
  enablePasswordReset="true"
  **requiresQuestionAndAnswer="false"**
  applicationName="/"
  requiresUniqueEmail="false"
  passwordFormat="Hashed"
  maxInvalidPasswordAttempts="5"
  minRequiredPasswordLength="7"
  minRequiredNonalphanumericCharacters="1"
  passwordAttemptWindow="10"
  passwordStrengthRegularExpression=""
/>

Wrong answer below:


Set the QuestionAndAnswerRequired property to false.

OTHER TIPS

Set requiresQuestionAndAnswer="false" in your web.config

i.e.:

<membership defaultProvider="MySqlMembershipProvider">
    <providers>
        <clear/>
        <add name="MySqlMembershipProvider" 
            type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
            connectionStringName="LocalSQL" 
            enablePasswordRetrieval="false" 
            enablePasswordReset="true" 
            requiresQuestionAndAnswer="false" 
            requiresUniqueEmail="false" 
            passwordFormat="Hashed" 
            maxInvalidPasswordAttempts="15" 
            minRequiredPasswordLength="5" 
            minRequiredNonalphanumericCharacters="0" 
            passwordAttemptWindow="10" 
            passwordStrengthRegularExpression="" 
            applicationName="/"/>
    </providers>
</membership>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top