<!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>
时间: 2024-10-10 23:19:52