会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
狂风的博客空间
学习的天地,记忆的天堂
博客园
首页
新随笔
新文章
管理
用ajax打造和gmail一样的加载进度条显示!(原创)
用ajax打造和gmail一样的加载进度条显示
<%
@ Page Language
=
"
C#
"
AutoEventWireup
=
"
true
"
CodeFile
=
"
Default2.aspx.cs
"
Inherits
=
"
Default2
"
%>
<
script
runat
="server"
>
void
Button1_Click(object sender, EventArgs e)
{
this
.Label1.Text
=
"
更新时间:
"
+
System.DateTime.Now.ToString();
System.Threading.Thread.Sleep(
2000
);
}
void
Button2_Click(object sender, EventArgs e)
{
this
.Label1.Text
=
"
更新时间:
"
+
System.DateTime.Now.ToString();
}
</
script
>
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
runat
="server"
>
<
title
>
UpdatePanel Trigger Sample
</
title
>
</
head
>
<
body
>
<
form
id
="form1"
runat
="server"
>
<
div
>
<
asp:ScriptManager
ID
="ScriptManager1"
runat
="server"
>
</
asp:ScriptManager
>
<
asp:UpdateProgress
ID
="UpdateProgress1"
runat
="server"
>
<
ProgressTemplate
>
<
div
style
="left: 0px; width: 127px; position: relative; top: 0px; background-color: #ffcc33; float: right;"
>
正在处理
</
div
>
</
ProgressTemplate
>
</
asp:UpdateProgress
>
</
div
>
<
asp:UpdatePanel
ID
="UpdatePanel1"
runat
="server"
>
<
ContentTemplate
>
<
div
>
<
asp:Button
ID
="Button1"
runat
="server"
Text
="异步回送"
OnClick
="Button1_Click"
/>
<
br
/>
<
br
/>
<
asp:Label
ID
="Label1"
runat
="server"
Text
="当前时间"
Font-Bold
="True"
Font-Size
="Large"
></
asp:Label
></
div
>
</
ContentTemplate
>
<
Triggers
>
<
asp:AsyncPostBackTrigger
ControlID
="Button1"
/>
<
asp:PostBackTrigger
ControlID
="Button2"
/>
</
Triggers
>
</
asp:UpdatePanel
>
</
form
>
</
body
>
</
html
>
posted on
2007-04-28 23:12
mecn
阅读(
1524
) 评论(
1
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部