Aspx <% @ Page Language = " C # " Masterpagefile = " ~ /Site. Master " Autoeventwireup = " True " Codefile = " 6_partialrenderingmechanism.aspx.cs " Inherits = " _ 6_partialrenderingmechanic " Title = " Partialrenderingmechanic " %>
< ASP: Content ID = " Content1 " Contentplaceholderid = " Contentplaceholder1 " Runat = " Server " >
< ASP: updatepanel ID = " Upchildrenastriggers " Runat = " Server " Childrenastriggers = " True " >
< Contenttemplate >
<% = Datetime. Now %> < BR />
< ASP: button ID = " Btnasyncpostback " Runat = " Server " Text = " Async PostBack button " /> < BR />
< ASP: button ID = " Btnfullpostback " Runat = " Server " Text = " Full PostBack button " /> < BR />
</ Contenttemplate >
< Triggers >
< ASP: postbacktrigger controlid = " Btnfullpostback " />
</ Triggers >
</ ASP: updatepanel >
< BR />
< HR />
< ASP: updatepanel ID = " Upnotchildrenastriggers " Runat = " Server " Childrenastriggers = " False " Updatemode = " Conditional " >
< Contenttemplate >
<% = Datetime. Now %> < BR />
< ASP: linkbutton ID = " Lbasyncpostback " Runat = " Server " > Async PostBack linkbutton </ ASP: linkbutton >
</ Contenttemplate >
< Triggers >
< ASP: asyncpostbacktrigger controlid = " Btnoutsideasyncpostbackbutton " />
</ Triggers >
</ ASP: updatepanel >
< ASP: button ID = " Btnoutsideasyncpostbackbutton " Runat = " Server " Text = " Outside async PostBack button " />
</ASP: Content>
CSProtected VoidPage_load (ObjectSender, eventargs E)
{
}
pay attention to the two trigger buttons
Asp: asyncpostbacktrigger controlid = " btnoutsideasyncpostbackbutton " />, this will be asynchronously updated
Asp: postbacktrigger controlid = " btnfullpostback " />, which causes page refresh