title: ASP.NET update panel doesn't update until second click
body: <p>I've looked for answers online but there are so many that I've tried that haven't worked. I have two buttons on the page a "like" and a "dislike" button. </p>
  
  <p>When I click on a button the updatepanel doesn't update but the like data for that user is inserted into the database. </p>
  
  <p>When I click on the button the second time the update panel gets refreshed and works for proceeding clicks. I want the update panel to refresh on the first click</p>
  
  <pre><code>&lt;form id="Matches" runat="server" class="form-horizontal"&gt;
  
          &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;&lt;/asp:ScriptManager&gt;
  
          &lt;asp:UpdatePanel ID="VotePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false" &gt;
              &lt;ContentTemplate&gt;
  
                  &lt;div class="row"&gt;
                &lt;!-- left column --&gt;
                      &lt;div class="col-lg-12 col-sm-12 col-xs-12"&gt;
                          &lt;div class="text-center"&gt;
                         ail" /&gt;
                              &lt;h1&gt;
                                  &lt;asp:Label ID="Label1" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;&lt;asp:Label ID="Label2" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;&lt;/h1&gt;
                              &lt;div class="btn-group"&gt;
                                  &lt;asp:Button ID="Button1" runat="server" CssClass="btn btn-default" Text="Like" OnClick="Button1_Click" /&gt;&lt;asp:Button ID="Button2" CssClass="btn btn-default" runat="server" Text="Dislike" OnClick="Button2_Click" /&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
  
              &lt;/ContentTemplate&gt;
              &lt;Triggers&gt;
                  &lt;asp:AsyncPostBackTrigger ControlID="Button1" /&gt;
  
                  &lt;asp:AsyncPostBackTrigger ControlID="Button2" /&gt;
                  &lt;/Triggers&gt;
          &lt;/asp:UpdatePanel&gt; 
  </code></pre>
  
  <p>C# Code</p>
  
  <pre><code>protected void Button1_Click(object sender, EventArgs e)
          {
              uservote.spAddLike(user.getId(), usermatch.getId());
              VotePanel.Update();
  
          }
          protected void Button2_Click(object sender, EventArgs e)
          {
              uservote.spAddDislike(user.getId(), usermatch.getId());
              VotePanel.Update();
          }
  </code></pre>