如何访问BetterCMS管理页面

时间:2014-06-04 11:36:15

标签: asp.net-mvc content-management-system

我借助以下链接在我的ASP.NET MVC应用程序中成功设置了BetterCMS:

http://www.devbridge.com/articles/better-cms-for-developers/

我现在可以查看以下页面: enter image description here

我现在如何看待管理部分? TX。

4 个答案:

答案 0 :(得分:2)

我确定你现在已经知道了这一点,但为了让这个帖子对其他人有用,你需要做的就是在你的localhost地址之后放/登录。

像这样:localhost:50720/login

答案 1 :(得分:0)

您在以下位置重新检查文件:" App_Start / RouteConfig.cs"。你配置如下:`



public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            //routes.MapRoute(
            //    name: "Default",
            //    url: "{controller}/{action}/{id}",
            //    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            //);
        }`




答案 2 :(得分:0)

只需评论"路线配置" global.ascx.cs文件中的方法。 与RouteConfig文件中的以下代码类似,注释寄存器路径。

要获取管理员设置,只需在主布局页面中使用以下模型

@{
    Layout = "~/Areas/bcms-Root/Views/Shared/BaseLayout.cshtml";
}

答案 3 :(得分:0)

将Global.asax替换为以下代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Routing;
using System.Security.Principal;
using BetterCms.Core;
using BetterCms.Core.Environment.Host;
using TestingCms.App_Start;


namespace TestingCms
{
    public class MvcApplication : System.Web.HttpApplication
    {
        private static ICmsHost cmsHost;
        protected void Application_Start()
        {
            cmsHost = CmsContext.RegisterHost();

        /* DO NOT FORGET TO REMOVE DEFAULT ROUTE REGISTRATION! 
           FOLLOWING SOURCE CODE SHOULD BE REMOVED: 

           routes.MapRoute(
                    name: "Default",
                    url: "{controller}/{action}/{id}",
                    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
                );
        */

        // [YOUR CODE]  

        cmsHost.OnApplicationStart(this);
    }

    protected void Application_BeginRequest()
    {
        // [YOUR CODE]

        cmsHost.OnBeginRequest(this);
    }

    protected void Application_EndRequest()
    {
        // [YOUR CODE]

        cmsHost.OnEndRequest(this);
    }

    protected void Application_Error()
    {
        // [YOUR CODE]

        cmsHost.OnApplicationError(this);
    }

    protected void Application_End()
    {
        // [YOUR CODE]

        cmsHost.OnApplicationEnd(this);
    }

    protected void Application_AuthenticateRequest(object sender, EventArgs e)
    {
        // [YOUR CODE]

        // Uncomment following source code for a quick Better CMS test if you don't have implemented users authentication. 
        // Do not use this code for production!

        var roles = new[] { "BcmsEditContent", "BcmsPublishContent", "BcmsDeleteContent", "BcmsAdministration" };
        var principal = new GenericPrincipal(new GenericIdentity("TestUser"), roles);
        HttpContext.Current.User = principal;


        cmsHost.OnAuthenticateRequest(this);
    }

}
}