日期:2014-05-17 浏览次数:20489 次
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lheader" runat="server" Font-Bold="True" Font-Size="Large" Text="使用UpdateProgress控件"></asp:Label><br />
<hr />
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<asp:Label ID="linfo" runat="server" Text="单击下面按钮进行测试"></asp:Label><br />
<asp:Button ID="btTest" runat="server" OnClick="btTest_Click" Text="测试" /><br />
<asp:Label ID="lResult" runat="server"></asp:Label>
</contenttemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<progresstemplate>
<div id="iLoading" style="font-weight: bold; font-size: large; left: 20px; text-transform: capitalize; color: red; font-family: Monospace; position: absolute; top: 50px; background-color: #99ccff;">
<img src="images/ajax-loader.gif" />
<img src="images/ajax-loader.gif" /></div>
</progresstemplate>
</asp:UpdateProgress>
</form>
</body>
</html>
protected void btTest_Click(object sender, EventArgs e)
{
//设置延迟时间,以便能显示UpdateProgress控件
System.Threading.Thread.Sleep(60000);
string strMsg = "欢迎访问IT在中国http://www.itzcn.com<br >";
strMsg += "当前时间是:" + DateTime.Now.ToString();
lResult.Text = strMsg;
}