0
我有一個ASP.NET 2010應用程序。當我經過registraiton過程中,我得到正確的登錄,但如果我只是稍後嘗試登錄,總的ValidateUser返回false」爲什麼Membership.ValidateUser()總是返回false?
blnSuccess = Membership.ValidateUser(strUserName, strPassword)
我已經通過加強,以確保正確的用戶名密碼&是被髮送進來並且這個人在db(Express)中。這是我的Web.Config ....所有隻是普通的東西。
<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>
如果成員被鎖定Membership.ValidateUser將返回false或者如果他/她是不是覈准或提供錯誤憑證。這些是原因 – 2013-02-21 11:16:43