我需要ASP MVC的帮助。 我:如何通过ActionLink提交表单
<% using (Html.BeginForm(null,null,FormMethod.Post)) {%>
<p>
<input type="submit" value="Choose" />
.
.
.
<%=Html.ActionLink("Save", "Index")%>
</p>
<% } %>
,我需要通过ActionLink的提交表单,因为我需要从下拉列表获得了selectedValue,我不知道任何方式如何做到这一点其他然后从的FormCollection或参数法属性POST。
所以我需要在点击动作链接后调用这个函数。
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(FormCollection formValues)
{
}
我试过用jquery和Ajax.ActionLink
但是所有的东西都叫做Index的GET方法。 (new { onclick = "$(this).parents('form').first().submit();"
- 没有为我工作 - 它也称为GET方法)
非常感谢您! 我在beginForm中犯了一个错误,现在它在jquery提交时工作正常,并且必须返回false,Jason如何说。 – Prazi