开发者

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" 
             enablePasswordRetrie开发者_StackOverflowval="false" 
             enablePasswordReset="true" 
             requiresQuestionAndAnswer="false" 
             requiresUniqueEmail="false" 
             maxInvalidPasswordAttempts="5" 
             minRequiredPasswordLength="6" 
             minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow="10" 
             applicationName="/"/>
    </providers>
    </membership>


Please take a look and see if this help you:

Membership.ValidateUser always returns false after upgrade to VS 2010 / .NET 4.0

Why might Membership.ValidateUser return false when the user is approved and is not locked out?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜