将开源mvc论坛1.5与asp.net身份表集成?

时间:2014-10-31 12:08:03

标签: asp.net-mvc-4

Mvc论坛1.5使用会员表但我的应用程序创建mvc 5 + Entity framework 6 + asp.net identity table.how将mvc论坛与我的应用程序集成。

1 个答案:

答案 0 :(得分:0)

Hi Mahaveer, 

You will have to do following changes in connection string and system.web:

The UserManagement_Connection  is basically a connection string 
 <add name="UserManagement_Connection" connectionString="Data Source=.\SQLExpress;Initial Catalog=ASPNETDB;Integrated Security=false;User Id=userId;Password=pwd" providerName="System.Data.SqlClient" />


<system.web>
    <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
      <providers>
        <clear />
        <add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="UserManagement_Connection" applicationName="myapplication" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" />
      </providers>
    </membership>
    <roleManager enabled="true" defaultProvider="RoleProvider">
      <providers>
        <add connectionStringName="UserManagement_Connection" applicationName="myapplication" name="RoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web,                   Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      </providers>
    </roleManager>


Then directly you can use the Membership functions in your application

Let me know if you face any issue.

:)