<!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 id="Head1" runat="server">
<Meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/Style/NiuLan.css" rel="stylesheet" type="text/css" />
<title></title>
<html xmlns=" http://www.w3.org/1999/xhtml ">
<head id="Head1" runat="server">
<Meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/Style/NiuLan.css" rel="stylesheet" type="text/css" />
<title></title>
//取得PageRequestManager对象,每一个Asp.net Ajax页面中会右唯一一个这种对象负责处理所有的Async - Postback要求
var prm = Sys.WebForms.PageRequestManager.getInstance(); //新增事件处理至PageRequestManager的initializeRequest事件,当Async-Postback发生时,此事件会被触发,我们的InitRequest函数便会被运行
var prm = Sys.WebForms.PageRequestManager.getInstance(); //新增事件处理至PageRequestManager的initializeRequest事件,当Async-Postback发生时,此事件会被触发,我们的InitRequest函数便会被运行
prm.add_initializeRequest(InitRequest);
//新增事件处理至PageRequestManager的endRequest事件,当Async-Postback完成时,此事件会被触发,我们的EndRequest函数便会被运行
prm.add_endRequest(EndRequest); function InitRequest(sender,args) {
//显示出UpdateProgress1控件
//新增事件处理至PageRequestManager的endRequest事件,当Async-Postback完成时,此事件会被触发,我们的EndRequest函数便会被运行
prm.add_endRequest(EndRequest); function InitRequest(sender,args) {
//显示出UpdateProgress1控件
document.getElementById('detail').style.display = "none";
}
function EndRequest(sender,args) {
//隐藏UpdateProgress1控件
document.getElementById('detail').style.display = "block";
//隐藏UpdateProgress1控件
document.getElementById('detail').style.display = "block";
}
//用于取消Async-Postback动作
function CancelClick() {
//当处于Async-Postback动作时,get_isInAsyncPostBack函数会回传true,此时调用abortPostBack 函数便会取消Async-Postback动作。
if (prm.get_isInAsyncPostBack()) {
prm.abortPostBack();
//用于取消Async-Postback动作
function CancelClick() {
//当处于Async-Postback动作时,get_isInAsyncPostBack函数会回传true,此时调用abortPostBack 函数便会取消Async-Postback动作。
if (prm.get_isInAsyncPostBack()) {
prm.abortPostBack();
}
}
</script>
}
</script>
</head>
<body >
<form id="Form1" runat="server">
//使用 Ajax Extensitons 中的ScriptManager
<asp:ScriptManager runat="server">
</asp:ScriptManager>
</asp:ScriptManager>
//使用地方比如
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<ContentTemplate>
//放代码
<div id="detail"><asp:ImageButton ID="ibtnFBSJ" runat="server" ImageUrl="/images/ershoufang/bs/fbsj.gif"
OnClick="ibtnFBSJ_Click" />
</div>
OnClick="ibtnFBSJ_Click" />
</div>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<div style="text-align: center">
<img alt="" src="/images/loading.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<ProgressTemplate>
<div style="text-align: center">
<img alt="" src="/images/loading.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>
</asp:UpdatePanel>
</form>
</body>
</body>
</html>
protected void ibtnFBSJ_Click(object sender,ImageClickEventArgs e)
{
System.Threading.Thread.Sleep(2000);
drpSortOrder.SelectedValue = ((int)ErShouFangJiChuZuFang.order.按发布时间排序).ToString();
PopulateDetails();
}
{
System.Threading.Thread.Sleep(2000);
drpSortOrder.SelectedValue = ((int)ErShouFangJiChuZuFang.order.按发布时间排序).ToString();
PopulateDetails();
}
当然 你也可以使用 jquery 或者ajax 写动态加载table的方式来实现
原文链接:https://www.f2er.com/ajax/166779.html