How can I update an UpdatePanel programmatically?

You can use the Update method of the UpdatePanel on the server side. Make sure to set
The UpdateMode of the UpdatePanel to Conditional to get it to work.

<asp:UpdatePanel UpdateMode="Conditional" ID="UpdatePanel1"...>
UpdatePanel1.Update()

You can also use triggers that will make sure the UpdatePanel listen to a control’s event and update if the event is fired and caused by a postback. Example:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
         <ContentTemplate>
               ...
         </ContentTemplate>
         <Triggers>
               <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
          </Triggers>
</asp:UpdatePanel>
<asp:Button ID="Button1" runat="server" Text="Button" />

Please do not post any spam link in the comment box😊

Post a Comment (0)
Previous Post Next Post