0
如何在我的MVC4應用程序中啓用角色管理器? 我需要爲我的應用程序用戶添加角色,並且我需要一個關於如何正確執行操作的摘要。在我的Asp.net MVC4 web應用程序中啓用角色管理器
如何在我的MVC4應用程序中啓用角色管理器? 我需要爲我的應用程序用戶添加角色,並且我需要一個關於如何正確執行操作的摘要。在我的Asp.net MVC4 web應用程序中啓用角色管理器
這就是我所需要的,希望能幫助他們擺脫困境。
要啓用角色管理器,則需要相應的標記添加到Web.config文件,不要忘記改變使=「TRU」 在角色管理器標籤implecitily
你可以找到ASP.Net應用程序的這些標籤: C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Config \ machine.config文件
<membership>
<providers>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
</providers>
</membership>
<profile>
<providers>
<add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</profile>
<roleManager>
<providers>
<add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</roleManager>