Вопрос

I'll trying to use the Sql Membership Provider with Login Control but the Login Control is creatting its own user, role, application.... tables but only used the user table...

I used aspnet_regsql for add tables and schema to my database to use Sql Membership

How can I configure Sql Membership for that the Login Control used the tables created by aspnet_regsql?

Below my web.config configuration for the providers:

 <membership defaultProvider="CrossReferenceWebSqlMembershipProvider">
    <providers>

       <add name="CrossReferenceWebSqlMembershipProvider" connectionStringName="CrossRef_DBConnectionString" enablePasswordRetrieval="false" 
            type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, &#xD;&#xA; PublicKeyToken=31bf3856ad364e35" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" 
            maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" 
            applicationName="CrossReferenceWeb" />
    </providers>
 </membership>

<profile defaultProvider="CrossReferenceWebSqlProfileProvider">
  <providers>
    <clear />
    <add name="CrossReferenceWebSqlProfileProvider" connectionStringName="CrossRef_DBConnectionString" 
         type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
         applicationName="CrossReferenceWeb" />
  </providers>
</profile>

<roleManager enabled="true" defaultProvider="CrossReferenceWebSqlRoleProvider">
  <providers>
    <clear />
    <add connectionStringName="CrossRef_DBConnectionString" applicationName="CrossReferenceWeb"
      name="CrossReferenceWebSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
</roleManager>
Это было полезно?

Решение

aspnet_regsql is deprecated. Please you use ASP.NET Universal Providers which uses Entity Framework.

You do not need to do extra set up for Login control. Login will automatically pick up the setting which you configured in Membership tag in web.config.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top