title: ASP.NET AJAX postbacks aborting
body: <p>I have an ASP.NET web page with two postback events and the second one is aborting the first.  The second one then doesn't render as expected once it completes.</p>
  
  <p><strong>In Detail</strong></p>
  
  <p>I have an ASP.NET web page that effectively contains two link buttons.  It uses the Telerik ASP.NET AJAX controls, but I'm not sure if the behaviour is specfic to these controls:</p>
  
  <p><em><strong>The Page</em></strong> - an extremely cut-down version is as follows:</p>
  
  <pre><code>&lt;telerik:RadToolTipManager ID="RadToolTipManager1" runat="server"
    Position="BottomLeft" RelativeTo="Element" ShowEvent="OnClick" 
    HideEvent="ManualClose" Animation="Fade" OnAjaxUpdate="OnShowItems" &gt;  
       &lt;TargetControls&gt;
            &lt;telerik:ToolTipTargetControl TargetControlID="btnShowItems" /&gt;
       &lt;/TargetControls&gt;
  &lt;/telerik:RadToolTipManager&gt;
  ...
  ...
  &lt;asp:LinkButton ID="btnShowItems" runat="server" Visible="false"&gt;
       &lt;span&gt;&lt;%= ItemsPrompt %&gt;&lt;/span&gt;
  &lt;/asp:LinkButton&gt;
  ...
  ...
  &lt;uc1:X ID="XControl" runat="server"/&gt;
  </code></pre>
  
  <p><em><strong>The UserControl "X"</em></strong> - an extremely cut-down version is as follows:</p>
  
  <pre><code>&lt;telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"
    LoadingPanelID="LoadingPanel1" RenderMode="Block"&gt;
      &lt;asp:LinkButton runat="server" ID="CausePostbackButton" 
        Style="display: none" /&gt;
  &lt;/telerik:RadAjaxPanel&gt;
  </code></pre>
  
  <p><em><strong>Use Case #1 - successful</em></strong></p>
  
  <ol>
  <li>The page loads and a JavaScript timer within Control "X" activates a postback on the LinkButton "CausePostbackButton" [eval(__doPostBack(postbackButtonClientID,''));].  (So, this mimics a user clicking the button).</li>
  <li>The AJAX call goes to the Server and <em>n</em> seconds later it returns and results in the page updating in a particular way.</li>
  <li>The user then clicks the LinkButton "btnShowItems" which causes a post-back to the Server and <em>n'</em> seconds later it returns and results in the page updating in a particular way.</li>
  </ol>
  
  <p><em><strong>Use Case #2 - failure</em></strong></p>
  
  <ol>
  <li><p>The page loads and a JavaScript timer within Control "X" activates a postback on the LinkButton "CausePostbackButton".  (So, this mimics a user clicking the button).</p></li>
  <li><p>Before the server has time to respond, the User clicks on the LinkButton "btnShowItems".</p></li>
  <li><p>In FireFox/Firebug, you can see that the first post-back event is "Aborted".  The second post-back event completes (you can see the time taken reported) but the page is not visually updated.</p></li>
  <li><p>If the "manual" button is then clicked again, then that works as expected.</p></li>
  </ol>
  
  <p><strong>My thoughts</strong></p>
  
  <ul>
  <li><p>I know that JavaScript is single threaded, so if events can't be run immediately then they are queued.</p></li>
  <li><p>I know that if a timer fires an event that is queued and then fires the same event whilst the first event is still queued, then one of these events (the second?) will be dropped.</p></li>
  <li><p>This is acting as if the first event is being trashed, but then the second event can no longer find its "channel" to write to.</p></li>
  </ul>
  
  <p>However, if I change the "manual" Link Button to an Image Button then the behaviour does not change.</p>
  
  <p>Any ideas what the problem is (and ideally a solution)?</p>
  
  <p>Many thanks in advance</p>
  
  <p>Griff</p>