zoukankan
html css js c++ java
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
>
查看全文
相关阅读:
SPOJ 8093 JZPGYZ
UVA1030 Image Is Everything
UVA11996 Jewel Magic
UVA11922 Permutation Transformer
UVA1479 Graph and Queries
P3224 [HNOI2012]永无乡
UVA11020 Efficient Solutions
UVA12206 Stammering Aliens
UVA11107 Life Forms
UVA11019 Matrix Matcher
原文地址:https://www.cnblogs.com/gwazy/p/1015080.html
最新文章
BZOJ 4259 残缺的字符串
BZOJ 4503 两个串
BZOJ 3473 字符串
P4233 射命丸文的笔记
P1659 [国家集训队]拉拉队排练
BZOJ 5261 Rhyme
P2495 [SDOI2011]消耗战
CF932G Palindrome Partition
P2178 [NOI2015]品酒大会
P3321 [SDOI2015]序列统计
热门文章
P5245 【模板】多项式快速幂
UVA11464 Even Parity
P4389 付公主的背包
SPOJ 10570 LONGCS
SPOJ 1811 LCS
SPOJ 1812 LCS2
P5283 [十二省联考2019]异或粽子
P4705 玩游戏
CF666E Forensic Examination
P4081 [USACO17DEC]Standing Out from the Herd
Copyright © 2011-2022 走看看