为什么Membership.ValidateUser()总是返回false? [英] Why does Membership.ValidateUser() always return false?

查看:53
本文介绍了为什么Membership.ValidateUser()总是返回false?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.NET 2010应用程序.当我完成registraiton流程时,可以正确登录.但是,如果稍后尝试登录,ValidateUser始终返回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)

我已逐步完成操作,以确保正确的用户名&正在发送密码,并且此人位于数据库(快速)中.这是我的Web.Config....

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>

推荐答案

请看一下是否对您有帮助:

Please take a look and see if this help you:

Membership.ValidateUser升级到VS 2010/.NET 4.0后始终返回false

为什么

这篇关于为什么Membership.ValidateUser()总是返回false?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆