Event excitation sequence of Sys. WebForms. PageRequestManager (AJAX request to add client events) in ajax

Source: Internet
Author: User

The test code is as follows:

<% @ Page Language = "C #" AutoEventWireup = "true" CodeBehind = "Default. aspx. cs" Inherits = "_ Default" %>

<Head runat = "server">
<Title> Sys. WebForms. PageRequestManager </title>
</Head>
<Body>
<Form id = "form1" runat = "server">

<Asp: ScriptManager ID = "ScriptManager1" runat = "server">
</Asp: ScriptManager>
<% = DateTime. Now. ToString () %> <Asp: UpdatePanel ID = "UpdatePanel1" runat = "server">
<ContentTemplate>
<% = DateTime. Now. ToString () %>
<Hr/>
<Asp: Button ID = "Button1" runat = "server" Text = "Button"/>
</ContentTemplate>
</Asp: UpdatePanel>
<Script type = "text/javascript" language = "javascript">
Sys. WebForms. PageRequestManager. getInstance (). add_initializeRequest (
Function (sender, e)
{
Alert ("add_initializeRequest ");
}
);


Sys. WebForms. PageRequestManager. getInstance (). add_endRequest (
Function (sender, e ){
Alert ("add_endRequest ");
}
);


Sys. WebForms. PageRequestManager. getInstance (). add_beginRequest (
Function (sender, e ){
Alert ("add_beginRequest ");
}
);


Sys. WebForms. PageRequestManager. getInstance (). add_pageLoaded (
Function (sender, e ){
Alert ("add_pageLoaded ");
}
);

Sys. WebForms. PageRequestManager. getInstance (). add_pageLoading (
Function (sender, e ){
Alert ("add_pageLoading ");
}
);

</Script>

</Form>
</Body>
</Html>

 

The final result is as follows:

1. When the page is accessed for the first time, the add_pageLoaded event is first triggered.

2. During asynchronous submission, the event excitation sequence is as follows:

Add_initializeRequest

Add_beginRequest

Add_pageLoading

Add_pageLoaded

Add_endRequest

Add_pageLoaded

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.