Ajax implementation of static refresh page process with load rotated picture _ajax related

Source: Internet
Author: User
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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.