什么是“enableSimpleMembership”=“true”的等效web.config配置:

时间:2013-03-04 23:25:56

标签: asp.net-mvc-4 web-config roleprovider simplemembership

Web.Config中的成员资格和角色提供程序的等效配置是什么:

<appSettings>
  <add key="enableSimpleMembership" value="true" />
</appSettings>
ASP.NET MVC 4中的

1 个答案:

答案 0 :(得分:4)

web.config的等效配置是:

<appSettings>
  <add key="enableSimpleMembership" value="false" /><!-- false is default if key is not present -->
</appSettings>
<connectionStrings>
  <add name="DefaultConnection" connectionString="..." providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
  <membership defaultProvider="SimpleMembershipProvider">
    <providers>
      <add name="SimpleMembershipProvider" type="WebMatrix.WebData.SimpleMembershipProvider" />
    </providers>
  </membership>
  <roleManager defaultProvider="SimpleRoleProvider" enabled="true">
    <providers>
      <add name="SimpleRoleProvider" type="WebMatrix.WebData.SimpleRoleProvider" />
    </providers>
  </roleManager>