MVC - Ajax.BeginForm()生成空操作

时间:2015-06-12 14:20:22

标签: asp.net-mvc http-post asp.net-mvc-routing html.beginform

当前网页网址:http://localhost:25265/SearchResultsList.aspx

视图看起来像:

@using (Html.BeginForm("RefineSearchResults", "Search", FormMethod.Post, new {id = "myForm"}))
{
 <input type="submit" value="submit" />
}

路线:

routes.MapRoute(
                "Search",
                "SearchResultsList.aspx",
                new { controller = "Search", action = "SearchResults" }
            );


routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}",
                defaults: new { controller = "Home", action = "Index"},
                namespaces: new[] { "MyApp.WebUI.Controllers" }
            );

但是,我注意到它产生了空洞的动作。 看起来像:

<form action method="post">
<input type="submit" value="submit"> </form>

任何人都可以告诉我这是怎么回事?在哪里我做错了!!

0 个答案:

没有答案