不调用RegisterArea()函数。 [英] does not call RegisterArea() function.

查看:173
本文介绍了不调用RegisterArea()函数。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AreaRegistration.RegisterAllAreas();

this function does not call this class

namespace ArleATPImportWebApp.Areas.ImportNightflight
{
    public class ImportNightflightAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "ImportNightflight";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "ImportNightflight_default",
                "ImportNightflight/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
               ,namespaces: new[] { "ArleATPImportWebApp.Areas.ImportNightflight.Controllers" }
            );
        }
    }
}


in _layout.cshtml i write that 
@Html.ActionLink("Nightflight - Upload and import rows", "Upload", new { controller = "ImportedDocs", area = "ImportNightflight" },null)

推荐答案

这篇关于不调用RegisterArea()函数。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆