//需要引入:
<head> <script src="~/Scripts/jquery-1.8.2.js"></script> <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script> <script type="text/javascript"> function newFunction(data) { alert(data); } </script> </head>
view页面:
<div> @using (Ajax.BeginForm("GetDate","MicroAjax",new AjaxOptions(){Confirm = "您确认要提交吗?", HttpMethod = "Post", InsertionMode = InsertionMode.Replace, UpdateTargetId = "result", OnSuccess = "newFunction", LoadingElementId = "loading" })) { <div> 用户名:<input type="text" name="UserName"/><br/> 密码:<input type="text" name="Password"/><br/> <input type="submit" value="提交"/> </div> <div id="result"></div> <div id="loading" style="display: none;"> <img src="~/Content/ico_loading2.gif" /> </div> } </div>??
??
(编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|