2

良い一日!

私は次のリンクを持っています:

<%: Url.Action(MVC.Areas.Manage.Feedback.Index()) %>

そして、それはとして生成され/Manage/feedbackます。アクション名とコントローラー名は小文字ですが、エリア名は小文字です。

私は最新のT4MVC2.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 に答える