2

我想使用会员等级和用户活动目录作为数据源。我在 web.config 中有这样的配置

<connectionStrings>
<add name="ApplicationServices"
  providerName="System.Data.SqlClient" />
<add name="LDAPConnectionString" connectionString="LDAP://myserver"/>

<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>

但是当我想访问 ASP.net WEB 应用程序管理器时,我遇到了这样的问题“遇到错误。请返回上一页再试一次。”

4

3 回答 3

0

试试这个(在确保您的连接字符串有效之前):

<membership>
  <providers>
    <clear/>
    <add name="AspNetSqlMembershipProvider" 
         type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
         connectionStringName="***ENTER CORRECT NAME OF YOUR CONN STRING" 
         enablePasswordRetrieval="false" 
         enablePasswordReset="true" 
         requiresQuestionAndAnswer="true" 
         applicationName="/" 
         requiresUniqueEmail="false" 
         passwordFormat="Hashed" 
         maxInvalidPasswordAttempts="5" 
         minRequiredPasswordLength="7" 
         minRequiredNonalphanumericCharacters="1" 
         passwordAttemptWindow="10" 
         passwordStrengthRegularExpression=""/>

  </providers>

</membership>
于 2012-11-26T04:50:54.213 回答
0

看来您connectionStringName应该设置为"LDAPConnectionString"not to "ApplicationServices"

于 2012-11-23T11:17:01.303 回答
0

您应该使用ActiveDirectoryMembershipProvider,而不是SqlMembershipProvider.

链接的 MSDN 文章有一个示例配置。

于 2012-11-26T07:38:48.247 回答