asyncpostbacktrigger(異步回調觸發器):局部刷新,只刷新updatepanel內部的內容
postbacktrigger(普通回調觸發器):全部刷新
復制代碼 代碼如下:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager> //必須有且一定在updatepanel前面
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<% =DateTime.Now.ToString()%>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btn" />
<asp:AsyncPostBackTrigger ControlID="btn2" EventName="click" />
</Triggers>
</asp:UpdatePanel>
<asp:Button runat="server" Text="刷新1" id="btn"/>
<asp:Button runat="server" Text="刷新2" id="btn2" />
<% =DateTime.Now.ToString()%>