TextBox AutoPostBack pre-empts further events
<p>In a simple ASP page, TextBox AutoPostBack events will prevent Button click events (except where button is tapped very quickly) and AutoPostBack events for other controls (like ListBox).</p>

<p>There's a similar question here, but I wasn't happy with being forced to use client side or AJAX solutions: <a href="http://stackoverflow.com/questions/3189034/have-to-click-button-twice-in-asp-net-after-autopostback-textbox">Have to click button twice in asp.net (after autopostback textbox)</a></p>

<p>Example ASPX page:</p>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="temp.aspx.cs" Inherits="temp" %&gt;
    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
    &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
    &lt;head runat="server"&gt;
        &lt;title&gt;Untitled Page&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;form id="form1" runat="server"&gt;
        &lt;div&gt;
            &lt;asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True" OnTextChanged="PostBack"&gt;&lt;/asp:TextBox&gt;
            &lt;asp:Button ID="Button1" runat="server" OnClick="PostBack" Text="Button" /&gt;&lt;br /&gt;
            &lt;asp:ListBox ID="ListBox1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="PostBack"&gt;
                &lt;asp:ListItem&gt;value1&lt;/asp:ListItem&gt;
                &lt;asp:ListItem&gt;value2&lt;/asp:ListItem&gt;
            &lt;/asp:ListBox&gt;&lt;br /&gt;
            &lt;br /&gt;
            Events Fired:&lt;br /&gt;
            &lt;asp:TextBox ID="TextBox2" runat="server" Height="159px" TextMode="MultiLine" Width="338px"&gt;&lt;/asp:TextBox&gt;&lt;/div&gt;
        &lt;/form&gt;
    &lt;/body&gt;
    &lt;/html&gt;
</code></pre>

<p>C# code behind:</p>

<pre><code>public partial class temp : System.Web.UI.Page
{
    protected void PostBack(object sender, System.EventArgs e)
    {
        this.TextBox2.Text += string.Format("PostBack for - {0}\n", ((System.Web.UI.Control)sender).ID);
    }
}
</code></pre>

<p>I've been able to partially solve this problem for buttons by using mousedown instead of click events to submit the form (I also blocked extra AutoPostBack events client-side and handled any extra field changes during button click events server side)</p>

<p>However, this means my buttons aren't quite behaving in the standard (click on release) way.</p>

<p>Is there a better solution to this problem that doesn't require trying to do everything in javascript client-side?  (I'm writing a lot of code that reads server data during these postbacks, so javascript isn't an ideal solution.)</p>

<p>I'm also trying to avoid switching to an AJAX library for these pages since every new library I add has to go through security auditing etc.  </p>

<p>Note: I'm currently working with ASP.Net 2.0/VS 2005, but if this type of problem is fixed in a later release that would be a compelling argument to upgrade.  (As far as I understand it, the same problem seems to happen in ASP.Net 4/VS 2010)</p>
