public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Manage_default",
"Manage/{controller}/{action}/{id}",
new { controller = "ControlBoard", action = "Index", id = UrlParameter.Optional },
new string[] { "EasyLottery.Web.Areas.Manage.Controllers" }
);
}
配置如上,通过/manage/controlboard 能正常访问
但直接访问/controlboard竟然也可以,请问下怎么限制,只能通过/manage/controlboard访问??
EasyLottery.Web.Areas.Manage.Controllers
指定的namespace是不是不对。
可改为
EasyLottery.Web.Areas.Manage.Controllers.{AreaName} //areaName是你的area名称
namespace 名字没写错
EasyLottery.Web.Areas.Manage.Controllers.{AreaName}
你把AreaName放在最后是什么套路