You can use an AsyncPostBackTrigger with the UpdatePanel to do this. Because you need something that can fire an event, using a button is fairly simple and when hidden works nicely.
If this is your markup:
<asp:UpdatePanel ID="UpdatePanel1" runat="server" OnLoad="UpdatePanel1_Load">
<ContentTemplate>
<!-- Contents... -->
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ReloadThePanel" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:Button ID="ReloadThePanel" runat="server" style="display:none;" />
When you want the panel to be updated, you just need to call:
__doPostBack('<%=ReloadThePanel.ClientID %>', null);
This will make ASP.NET think that ReloadThePanel was clicked and the JavaScript auto-generated due to the trigger will handle the rest.
EDIT
You can do a pure JavaScript update of the UpdatePanel without any triggers or hidden buttons. You just need to invoke __doPostBack
with the client-side ID as the first argument.
__doPostBack('<%=UpdatePanel1.ClientID %>', null);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…