0

지금은 SQL Server에 액세스 할 수 없어 데이터베이스 파일 만 사용하여 mvc 페이지의 역할을 사용하여 사용자 멤버십을 지원하도록 web.config 파일을 설정할 수 있습니까?asp2 역할 및 web.config의 멤버십 설정

<authentication mode="Forms">  
    <forms loginUrl="~/Account/LogOn" 
    protection="All" 
    timeout="30" 
    name="AppNameCookie" 
    path="~/Account/LogOn" 
    requireSSL="false" 
    slidingExpiration="true" 
    defaultUrl="default.aspx" 
    cookieless="UseCookies" 
    enableCrossAppRedirects="false" /> 
</authentication> 

<membership defaultProvider="MyMembershipProvider"> 
    <providers> 
    <clear/> 
    <add name="MyMembershipProvider" type="NudaJeFuc.WebUI.Classes.MyMembershipProvider" 
     enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" 
     maxInvalidPasswordAttempts="5" MinRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" 
     applicationName="/" /> 
    </providers> 
</membership> 

<profile> 
    <providers> 
    <clear/> 
    <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" /> 
    </providers> 
</profile> 

<roleManager> 
    <providers> 
    <clear/> 
    <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" /> 
    <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" /> 
    </providers> 
</roleManager> 

<pages> 
    <namespaces> 
    <add namespace="System.Web.Mvc" /> 
    <add namespace="System.Web.Mvc.Ajax" /> 
    <add namespace="System.Web.Mvc.Html" /> 
    <add namespace="System.Web.Routing" /> 
    <add namespace="NudaJeFuc.WebUI.HtmlHelpers"/> 
    </namespaces> 
</pages> 

답변

1

귀하의 Web.config 잘 보이지만 당신이 가리 키도록 (귀하의 경우 ApplicationServices 이름)을 connectionString을 설정해야 멤버십 데이터베이스를 저장할 SQL 서버.

마법사를 사용하여 멤버십 데이터베이스를 만들 수 있습니다. VS cmd에서 aspnet_regsql을 실행하기 만하면됩니다. MSDN에 대한 자세한 내용을 볼 수 있습니다.

관련 문제