The following uses the simplest example of the callback: button callback to sort out the order of functions executed in the callback process.
Code As follows: <% @ Page Language = " C # " Autoeventwireup = " True " Codefile = " Test. aspx. CS " Inherits = " Test " %>
<% @ Register tagprefix = " Anthem " Assembly = " Anthem " Namespace = " Anthem " %>
<!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 Runat = "Server" >
< Title > Untitled page </ Title >
< Script Type = "Text/JavaScript" Language = "JavaScript" >
Function Anthem_precallback (){
Alert ('anthem _ precallback ');
If ( ! Confirm ('callback ? '))
Return False ;
}
Function Btn1_precallback (){
Alert ('btn1 _ precallback ');
If ( ! Confirm ('callback ? '))
Return False ;
}
Function Btn1_callbackcacelled (){
Alert ('btn1 _ callbackcacelled ');
}
Function Btn1_postcallback (){
Alert ('btn1 _ postcallback ');
}
Function Anthem_callbackcancelled (){
Alert ('anthem _ callbackcancelled ');
}
Function Anthem_error (result ){
Alert (result. Error );
}
Function Anthem_postcallback (){
Alert ('anthem _ postcallback ');
}
</ Script >
</ Head >
< Body >
< Form ID = "Form1" Runat = "Server" >
< Div >
< Anthem: button ID = "Btn1" Runat = "Server" Text = "Button 1" Onclick = "Btn1_onclick"
Precallbackfunction = "Btn1_precallback"
Callbackcancelledfunction = "Btn1_callbackcacelled"
Postcallbackfunction = "Btn1_postcallback" />
</ Div >
</ Form >
</ Body >
</ Html >
Background code:Protected VoidBtn1_onclick (ObjectSender, eventargs E)
{
Anthem. Manager. addscriptforclientsideeval ("Alert ('script for eval ')");
Throw NewException ("Error Message");
}
The flowchart is as follows: