John Beebee
John Beebee

Reputation: 43

Why does Membership.ValidateUser() always return false?

I have an ASP.NET 2010 app. When I go through the registraiton process, I correctly get logged in. However, if I just try to log in later, ValidateUser always returns false'

blnSuccess = Membership.ValidateUser(strUserName, strPassword)

I've stepped through to ensure the correct username & password are being sent in and that this person is in the db (Express). Here's my Web.Config....All just regular stuff.

<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>

<authentication mode="Forms">
<forms 
      name=".ASPXAUTH"
      loginUrl="~/Account/Login.aspx"
      protection="All"
      timeout="2880"
      slidingExpiration="true"
 />
</authentication>   
    <membership>
    <providers>
    <clear/>
    <add name="AspNetSqlMembershipProvider"
             type="System.Web.Security.SqlMembershipProvider" 
             connectionStringName="ApplicationServices" 
             enablePasswordRetrieval="false" 
             enablePasswordReset="true" 
             requiresQuestionAndAnswer="false" 
             requiresUniqueEmail="false" 
             maxInvalidPasswordAttempts="5" 
             minRequiredPasswordLength="6" 
             minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow="10" 
             applicationName="/"/>
    </providers>
    </membership>

Upvotes: 0

Views: 10444

Answers (1)

Related Questions