How do you use an UpdatePanel properly?

Example of code:

<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="updatePanel1">
        <asp:CheckBox runat="server" ID="myCheckBox" Caption="CheckBox"/>
        <asp:Button runat="server" ID="saveButton" 
                   Caption="Save" OnClick="SaveButtonClick"/>
        <asp:AsyncPostBackTrigger ControlID="saveButton" EventName="Click" />        

Make sure that:

  1. UpdateMode of UpdatePanel is Conditional
  2. SaveButton contained in Triggers-section as ControlID of AsyncPostBackTrigger

Your code behind should look like:


As when you hit Save button your re-drawing() method is called and it again refreshes your checkboxes. Asynchronous postback behaves and hit to page method the same as full postback, but refreshes the values in any updatepanels.

Also check this URL

Make sure the Save button is inside the Update Panel, for a start, and if not, that is designated as a Trigger for the Update Panel, in the <Triggers> section of the Update Panel.

<asp:UpdatePanel ID="MyControlPanel" runat="server" UpdateMode="Conditional">
        <asp:AsyncPostBackTrigger ControlID="SaveButton" />
    <ContentTemplate> ...

Can you show some code for your UpdatePanel?