mvc 3.0 ajax.beginForm 跳转 是怎么会是
前台代码:
<script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-1.5.1.js" type="text/javascript"></script>
@using (Ajax.BeginForm("GetDate", "Ajax", new AjaxOptions() {
Confirm = "确定吗?",
HttpMethod = "post",
InsertionMode = InsertionMode.InsertAfter,
UpdateTargetId = "ajaxid", }))
{ <input type="text" name="txtname" /> <br /> <input type="submit" value="提交" /> }
<div id="ajaxid"> </div>
后台:
public ActionResult GetDate()
{
return Content(DateTime.Now.ToString());
}
点击提交
直接跳转到 getdate action 下
<script src="../../Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript"></script>
少引入一个js
解决跳转的问题
mvc 3.0 ajax.beginForm 跳转 是怎么会是???什么意思??
点击提交
直接跳转到 getdate action 下
what???
mvc 3.0 mvc2.0同样写法正常