<div id="loadinfo" style="visibility:hidden; Z-INDEX: 12000; LEFT: 0px; WIDTH: 100%; CURSOR: wait; POSITION: absolute; TOP: 0px; HEIGHT: 100%"> <table width="100%" height="100%"> <tr align="center" valign="middle"> <td> <table width="169" height="62" bgcolor="#99cccc" style="FILTER: Alpha(Opacity=75); WIDTH: 169px; HEIGHT: 62px"> <tr align="center" valign="middle"> <td>页面提交中.<br/> Loading....</td> </tr> </table> </td> </tr> </table> </div> <input id="Button1" type="button" value="Get ServerTime" onclick ="javascript:GetTime();void(0)" />
// loading效果 AjaxPro.onLoading = function(b) { var a = document.getElementById("loadinfo"); a.style.visibility = b ? "visible" : "hidden"; } function GetTime() { // 调用服务端方法 //调用方法:类名.方法名 (参数为指定一个回调函数) _Default.GetServerTime(); }
[AjaxPro.AjaxMethod] //申明是ajaxPro方法 public void GetServerTime() { System.Threading.Thread.Sleep(2000); return DateTime.Now.ToString(); }