asp mvc 分区项目,怎样程序一运行就 运行Areas后台页面呀,添加了区域路由也是运行的前台
aspmvc分区项目,怎样程序一运行就运行Areas后台页面呀,添加了区域路由也是运行的前台我想程序一运行就是后台呀...
asp mvc 分区项目,怎样程序一运行就 运行Areas后台页面呀,添加了区域路由也是运行的前台我想程序一运行就是后台呀
展开
1个回答
展开全部
区域路由添加正确吗?给你添加区域路由的个例子:
public class CodeMaticModuleAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "CodeMaticModule";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
this.AreaName + "_Default",
this.AreaName + "/{controller}/{action}/{id}",
new { area = this.AreaName, controller = "Home", action = "Index", id = UrlParameter.Optional },
new string[] { "LeaRun.WebApp.Areas." + this.AreaName + ".Controllers" }
);
}
}
public class CodeMaticModuleAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "CodeMaticModule";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
this.AreaName + "_Default",
this.AreaName + "/{controller}/{action}/{id}",
new { area = this.AreaName, controller = "Home", action = "Index", id = UrlParameter.Optional },
new string[] { "LeaRun.WebApp.Areas." + this.AreaName + ".Controllers" }
);
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询