美好的一天!
我有以下链接:
<%: Url.Action(MVC.Areas.Manage.Feedback.Index()) %>
它生成为/Manage/feedback
。操作和控制器名称是小写的,但区域名称 - 不是。
我使用最新的T4MVC 2.6.43进行了这样的设置:
// Choose whether you want to include an 'Areas' token when referring to areas.
// e.g. Assume the Area is called Blog and the Controller is Post:
// - When false use MVC.Blog.Post.etc...
// - When true use MVC.Areas.Blog.Post.etc...
static bool IncludeAreasToken = true;
// If true, use lower case tokens in routes for the area, controller and action names
static bool UseLowercaseRoutes = true;
提前致谢!
答案 0 :(得分:2)
啊,我的错,我应该在ManageAreaRegistration.cs
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Manage_default",
"manage/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
}