Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<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 refreshing the original page display data will not be hidden inside this is a hidden function
Get the PageRequestManager object, each asp.net ajax page will be the only one of these objects responsible for handling all the 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);
The new event is processed to the PageRequestManager endrequest event, and when Async-postback completes, the event is triggered and our endrequest function is run
Prm.add_endrequest (endrequest); function Initrequest (sender, args) {
Display the UpdateProgress1 control
document.getElementById (' detail '). Style.display = "None";
}
function endrequest (sender, args) {
Hide UpdateProgress1 Control
document.getElementById (' detail '). Style.display = "block";
}
Used to cancel 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>
<body >
<form id= "Form1" runat= "Server" >
Using the ScriptManager in Ajax extensitons
<asp:scriptmanager runat= "Server" >
</asp:ScriptManager>
Use places like
<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>
Call UpdateProgress When you refresh the page statically but this backstage also needs code. Look below
<asp:updateprogress id= "UpdateProgress1" runat= "Server" associatedupdatepanelid= "UpdatePanel1" >
<ProgressTemplate>
<div style= "Text-align:center" >
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
Background
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 loading process has rotated pictures, the user experience will be very good results as follows
Of course, you can also use jquery or Ajax to write dynamic loading table to achieve