T4MVC: имя области в URL-адресе не в нижнем регистре

Добрый день!

У меня есть следующая ссылка:

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

Заранее спасибо!


person artvolk    schedule 03.03.2011    source источник


Ответы (1)


Ах, моя вина, я должен изменить это на нижний регистр в ManageAreaRegistration.cs

public override void RegisterArea(AreaRegistrationContext context)
{
    context.MapRoute(
        "Manage_default",
        "manage/{controller}/{action}/{id}",
        new { action = "Index", id = UrlParameter.Optional }
    );
}
person artvolk    schedule 03.03.2011