Html.BeginRouteForm被重定向到错误的操作?

时间:2013-02-23 18:28:31

标签: asp.net asp.net-mvc asp.net-mvc-3 razor

我认为这是:

@using (Html.BeginRouteForm("Forums_default", new { action = "RewardPost", item = Model.PostId }, FormMethod.Post, new { @class = "reward" }))

现在,这些是我的路线:

context.MapRoute(
    "Forums_thread",
    "Forums/{action}/{category}/{item}",
    new { controller = "Forums" }
);

context.MapRoute(
    "Forums_category",
    "Forums/{category}",
    new { controller = "Forums", action = "ThreadList" }
);

context.MapRoute(
    "Forums",
    "Forums/",
    new { controller = "Forums", action = "CategoryList" }
);

context.MapRoute(
    "Forums_default",
    "Forums/{action}/{item}",
    new { controller = "Forums", action = "CategoryList", item = UrlParameter.Optional }
);

这是正在生成的表单:

<form action="/Forums/RewardPost/11" class="reward" method="post" novalidate="novalidate">...
</form>

这就是重定向我的地方:/Forums/AddPost/4

现在的问题是:这里发生了什么?我该如何解决这个问题?

0 个答案:

没有答案