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