What would be equivalent web.config configuration for “enableSimpleMembership”="true:

拥有回忆 提交于 2019-12-01 06:25:19

问题


What would be equivalent configuration of Membership and Role providers in Web.Config for:

<appSettings>
  <add key="enableSimpleMembership" value="true" />
</appSettings>

in ASP.NET MVC 4?


回答1:


Equivalent configuration of web.config would be:

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


来源:https://stackoverflow.com/questions/15213093/what-would-be-equivalent-web-config-configuration-for-enablesimplemembership

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!