📄 onloading.aspx
字号:
<%@ Page language="c#" ClassName="LoadingDemo" Inherits="System.Web.UI.Page" %>
<script runat="server" language="c#">
private void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(LoadingDemo));
}
[AjaxPro.AjaxMethod]
public DateTime LongOperation()
{
System.Threading.Thread.Sleep(2000);
return DateTime.Now;
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Ajax.NET - OnLoading Example</title>
<link rel="stylesheet" type="text/css" href="../../css/main.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<form id="Form1" method="post" runat="server"></form>
<div class="content">
<h1>OnLoading Examples</h1>
<p>Click <a href="javascript:doTest1();void(0);">here</a> to start a long operating method (2 seconds). After you have clicked on the link you should see a <i>Loading...</i> message in the upper left corner.</p>
</div>
<div id="loadinfo" style="visibility:hidden;position:absolute;left:0px;top:0px;background-color:Red;color:White;">Loading...</div>
<p class="footer">Last updated: November 2, 2005 by <a href="http://weblogs.asp.net/mschwarz/contact.aspx" target="_blank">Michael Schwarz</a></p>
<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a></p>
<script type="text/javascript" defer="defer">
ASP.LoadingDemo.onLoading = function(b) {
var l = document.getElementById("loadinfo");
l.style.visibility = b ? "visible" : "hidden";
}
function doTest1() {
ASP.LoadingDemo.LongOperation(doTest1_callback);
}
function doTest1_callback(res) {
alert(res.value);
}
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -