Ajax implementation static Refresh page with load rotate picture

Source: Internet
Author: User

<! 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

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.