简体   繁体   English

ASP.NET:“无法找到默认成员资格提供程序”错误

[英]ASP.NET: “Default Membership Provider could not be found” error

In ASP.NET Web Application, i attempted to use login control with the connected database I got this error: 在ASP.NET Web应用程序中,我试图使用连接数据库的登录控件我收到此错误:

Default Membership Provider could not be found. 找不到默认成员资格提供程序。

Why is membership provider giving this error? 为什么会员提供商会出现此错误?

web.config file: web.config文件:

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionStrings>
    <add name="ResearchClub" connectionString="Data Source=PSYCOZ;Initial Catalog=ResearchClub;Integrated Security=True"/>
  </connectionStrings>

  <appSettings>
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>
  </appSettings>

  <system.web>
    <compilation debug="true" targetFramework="4.5.2"/>
    <httpRuntime targetFramework="4.5.2"/>

    <authentication mode="Forms"/>

    <membership>
      <providers>
        <clear/>
        <remove name="ResearchClubMembershipProvider"/>
        <add name="ResearchClubMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ResearchClub"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="10" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10"
             applicationName="/"/>
      </providers>
    </membership>

  </system.web>

  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
</configuration>

defaultProvider="ResearchClubMembershipProvider"添加到您的会员元素。

<membership defaultProvider="ResearchClubMembershipProvider">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM