首页 > 编程 > .NET > 正文

Asp.net ajax实现任务提示页面的简单代码

2024-07-10 13:15:08
字体:
来源:转载
供稿:网友

复制代码 代码如下:


<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    void WaitFiveSeconds(object o, EventArgs e)
    {
        System.Threading.Thread.Sleep(5000);
        Label1.Text = DateTime.Now.ToLongTimeString( );
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ASP.NET AJAX</title>
</head>
<body>
<form runat="server">
    <asp:ScriptManager runat="server" />
    <asp:UpdatePanel runat="server">
        <ContentTemplate>
            <asp:Button runat="server" Text="Do something" /><br />
            <asp:Label runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
        <div>
            Loading, please stand by ...
        </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
</form>
</body>
</html>

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表