微软Ajax异步
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Index</title> <script src="~/Scripts/jquery-1.8.0.js"></script> <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script> </head> <body> <div> @Html.MyHtmlStringLabel("javensdfasdfasdfsadfsadfsadfwerqwerqwrqwrqwrqwerwerqwerqwerqwerwq",10) @using (Ajax.BeginForm("data", "Default", new AjaxOptions { Confirm = "你确定要继续吗?",//确定对话框 HttpMethod = "post",//请求类型 UpdateTargetId = "data",//获取到响应后更新设置的元素ID InsertionMode=InsertionMode.Replace, LoadingElementId=""//请求时加载动画元素ID })) { <input type="submit" value="获取服务器时间" /> <div id="data"></div> } </div> </body> </html>
posted on 2017-07-29 13:21 LarvaAndQing 阅读(110) 评论(0) 编辑 收藏 举报