2

再会!

我有以下链接:

<%: 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;

提前致谢!

4

1 回答 1

2

啊,我的错,我应该把这个改成小写ManageAreaRegistration.cs

public override void RegisterArea(AreaRegistrationContext context)
{
    context.MapRoute(
        "Manage_default",
        "manage/{controller}/{action}/{id}",
        new { action = "Index", id = UrlParameter.Optional }
    );
}
于 2011-03-03T13:46:41.210 回答