<! 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>
<script type= "Text/javascript" >//when the original page of the refresh of the display data will not hide this is a hidden function
//Get PageRequestManager object, every asp.net ajax page will be the only one of these objects responsible for handling all async-postback requirements
var prm = Sys.WebForms.PageRequestManager.getInstance (); The new event is processed to the PageRequestManager initializerequest event, and when async-postback occurs, the event is triggered and our initrequest function is run
prm.add_initializerequest (initrequest);
//new event processing to PageRequestManager endrequest event, when Async-postback completes, this event is triggered and our endrequest function is run
prm.add_endrequest (endrequest); function Initrequest (sender, args) {
//Display UPDATEPROGRESS1 control
document.getElementById (' detail '). Style.display = "None";
}
function endrequest (sender, args) {
//Hide UpdateProgress1 control
document.getElementById (' detail '). Style.display = "block";
}
//For canceling Async-postback action
function Cancelclick () {
//When the Async-postback action is in, the Get_isinasyncpostback function will return true, and the Async-postback action will be canceled when the abortPostBack function is invoked.
if (Prm.get_isinasyncpostback ()) {
Prm.abortpostback ();
}
}
</script>
</head>
<body >
<form id= "Form1" runat= "Server" >
//Using the ScriptManager
in Ajax extensitons
<asp:scriptmanager runat= "Server" >
</asp:ScriptManager>
//Use places such as
<asp:updatepanel id= "UpdatePanel1" runat= "Server" >
<ContentTemplate>
//Put code
<div id= "detail" ><asp:imagebutton id= "IBTNFBSJ" runat= "Server" Imageurl= "/images/ershoufang/bs/ Fbsj.gif "
onclick= "Ibtnfbsj_click"/>
</div>
//When the page is statically refreshed updateprogress but this backstage is also the need for code to look below
<asp:updateprogress id= "UpdateProgress1" runat= "Server" associatedupdatepanelid= "UpdatePanel1" >
<ProgressTemplate>
<div style= "Text-align:center" >
<img alt= "" src= "/images/loading.gif"/>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
Backstage
protected void Ibtnfbsj_click (object sender, ImageClickEventArgs e)
{
System.Threading.Thread.Sleep (2000);
Drpsortorder.selectedvalue = ((int) ershoufangjichuzufang.order. Sorted by publication time). ToString ();
populatedetails ();
}
//This can be implemented as a static refresh page, with the load process has rotated pictures, the user experience will be very good results as follows