我在我的MVC4應用程序中設置了BetterCMS。它似乎是工作,除非我不知道如何配置它使用MVC4互聯網應用程序隨附的簡單成員資格提供程序。BetterCMS with MVC4簡單的會員供應商
http://www.devbridge.com/articles/better-cms-for-developers
請幫助!感謝
編輯:我使用的是Internet模板,配有簡單的成員資格提供已配置和工作創造了我MVC4應用程序。我想讓那些我已經註冊爲BetterCMS用戶的會員。
我在我的MVC4應用程序中設置了BetterCMS。它似乎是工作,除非我不知道如何配置它使用MVC4互聯網應用程序隨附的簡單成員資格提供程序。BetterCMS with MVC4簡單的會員供應商
http://www.devbridge.com/articles/better-cms-for-developers
請幫助!感謝
編輯:我使用的是Internet模板,配有簡單的成員資格提供已配置和工作創造了我MVC4應用程序。我想讓那些我已經註冊爲BetterCMS用戶的會員。
如果你想用更好的CMS,使用BetterCms.Module.Users模塊從的NuGet與它的角色提供,會員供應商和用戶界面,用於管理用戶。如何設置用戶模塊,您可以在BetterCMS wiki pages on Github
閱讀,但如果你仍然希望使用更好的CMS簡單的成員資格提供,請按照下列步驟操作。這就是我所做的,對我來說工作得很好。
不要忘記從RouteConfig類中刪除默認路由註冊(routes.MapRoute(name: "Default" ....
)。 在RouteConfig類中註冊以下路由。之後MVC主頁可以通過URL /家庭達到/:
routes.MapRoute("mvc-account-controller", "account/{action}/{id}", new
{
area = string.Empty,
controller = "Account",
action = "Login",
id = UrlParameter.Optional
});
routes.MapRoute("mvc-home-controller", "home/{action}/{id}", new
{
area = string.Empty,
controller = "Home",
action = "Index",
id = UrlParameter.Optional
});
作用提供商和成員提供程序添加到web.config中(溶液發現here):
<roleManager enabled="true" defaultProvider="simple">
<providers>
<clear/>
<add name="simple" type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData"/>
</providers>
</roleManager>
<membership defaultProvider="simple">
<providers>
<clear/>
<add name="simple" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData"/>
</providers>
</membership>
添加LazyInitializer全球如的.asax解釋here
有兩種方法來設置管理員角色的用戶(你可以閱讀更多的Better CMS Github Wiki, topic "CMS configuration"):
fullAccessRoles="Role1"
)添加角色映射在cms.config的安全部分:
<customRoles>
<add permission="BcmsEditContent" roles="Role1" />
<add permission="BcmsPublishContent" roles="Role1" />
<add permission="BcmsDeleteContent" roles="Role1" />
<add permission="BcmsAdministration" roles="Role1" />
</customRoles>
運行應用程序。轉到url/account/login並使用在第二步中創建的admininstrator帳戶登錄。然後返回任何CMS頁面,例如根頁面(/)。 在這裏,你以管理員身份連接,CMS側欄可用於網站編輯。
你可以更具體的問題是什麼?你是第一次使用MVC4互聯網模板創建你的應用程序還是你想添加SimpleMembership,因爲它目前不在那裏?你有什麼嘗試?你有沒有例外? –