@using (Ajax.BeginForm("Test", "Mobi", null, new AjaxOptions { UpdateTargetId = "ajax", HttpMethod = "Post", InsertionMode = InsertionMode.Replace }))
{
@Html.ValidationSummary(true)
<fieldset>
<ul data-role="listview" data-inset="true" style="text-align: center">
<li data-role="fieldcontain">
@Html.TextBox("key", null, new { placeholder = "输入订单号" })
@* <input type="submit" value="查找" />*@ </li>
</ul>
</fieldset>
<input type="submit" value="查找" data-theme="c" />
}
点击查找后跳转到Test的页面了
在线等!求解答!
@* <input type="submit" value="查找" />*@ </li>
</ul>
这条语句是注释掉的吗
1.Ajax.BeginForm("Test", "Mobi", null, new AjaxOptions { UpdateTargetId = "ajax", HttpMethod = "Post", InsertionMode = InsertionMode.Replace }))
Ans:Test是你控制器的名字;Mobi是action吧
2.<input type="submit" value="查找" data-theme="c" />
submit 提交了
听听其他大侠的建议,我还真分析不出来
需要加上
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" ></script>
因为页面中引用了Jquerymobile,所以需要加入
$(document).ready(function () {
$.mobile.ajaxEnabled = false;
});