会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
boytomato
asp.net ajax 提交中,暂停提交
from msdn
protected
void
Button1_Click(
object
sender, EventArgs e)
{
System.Threading.Thread.Sleep(
3000
);
Label1.Text
=
System.DateTime.Now.ToString();
}
<%
@ Page Language
=
"
C#
"
AutoEventWireup
=
"
true
"
CodeBehind
=
"
WebForm1.aspx.cs
"
Inherits
=
"
WebApplication1.WebForm1
"
%>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
runat
="server"
>
<
title
>
Untitled Page
</
title
>
</
head
>
<
body
>
<
form
id
="form1"
runat
="server"
>
<
div
>
</
div
>
<
asp:ScriptManager
ID
="ScriptManager1"
runat
="server"
>
</
asp:ScriptManager
>
<
script
type
="text/javascript"
>
var
prm
=
Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(InitializeRequest);
function
InitializeRequest(sender, args)
{
if
(prm.get_isInAsyncPostBack())
{
args.set_cancel(
true
);
}
}
function
AbortPostBack()
{
if
(prm.get_isInAsyncPostBack())
{
prm.abortPostBack();
}
}
</
script
>
<
asp:UpdatePanel
ID
="UpdatePanel1"
runat
="server"
>
<
ContentTemplate
>
<
asp:Button
ID
="Button1"
runat
="server"
Text
="Button"
onclick
="Button1_Click"
/>
<
asp:Label
ID
="Label1"
runat
="server"
Text
="Label"
></
asp:Label
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
<
asp:UpdateProgress
ID
="UpdateProgress1"
runat
="server"
>
<
ProgressTemplate
>
正在加载数据!
<
br
/>
<
input
type
="button"
value
="stop"
onclick
="AbortPostBack()"
/>
</
ProgressTemplate
>
</
asp:UpdateProgress
>
</
form
>
</
body
>
</
html
>
posted on
2007-12-26 09:54
gwazy
阅读(
813
) 评论(
1
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
导航
博客园
首页
新随笔
联系
订阅
管理
公告