title: AutoPostBack: true vs false
body: <p>Before I begin, I have already seen <a href="https://stackoverflow.com/questions/12173914/difference-betwwen-autopostback-true-and-autopostback-false">this question about a very similar topic</a> (as well as <a href="https://stackoverflow.com/questions/3778944/what-will-happen-when-autopostback-is-true-and-when-it-is-false">this one</a> and <a href="https://stackoverflow.com/questions/2409516/please-help-me-understand-autopostback-property-of-an-asp-net-control">this one</a>), none of which answer my question completely. I already understand the concepts presented in these questions/answers, but I have more questions.</p>
  
  <p><b>A)</b> What happens if you have multiple controls with <code>AutoPostBack="false"</code> and you change a number of them before a postback? Take the following brief example (assume that everything else needed for the page is written correctly and trivially; e.g., <code>Page_Load</code>):</p>
  
  <p>Default.aspx:</p>
  
  <pre><code>&lt;asp:DropDownList ID="ddlFoo" runat="server" 
      OnSelectedIndexChanged="ddlFoo_Changed" AutoPostBack="false" &gt;
      &lt;asp:ListItem Text="a" /&gt;
      &lt;asp:ListItem Text="b" /&gt;
      &lt;asp:ListItem Text="c" /&gt;
  &lt;/asp:DropDownList&gt;
  &lt;asp:DropDownList ID="ddlBar" runat="server" 
      OnSelectedIndexChanged="ddlBar_Changed" AutoPostBack="false" &gt;
      &lt;asp:ListItem Text="1" /&gt;
      &lt;asp:ListItem Text="2" /&gt;
      &lt;asp:ListItem Text="3" /&gt;
  &lt;/asp:DropDownList&gt;
  &lt;asp:Button ID="btnQux" runat="sever" Text="Click for PostBack" OnClick="btnQux_Click"
  </code></pre>
  
  <p>Default.aspx.cs:</p>
  
  <pre><code>protected void ddlFoo_Changed(object sender, EventArgs e)
  {
      Response.Write("ddlFoo changed to " + ddlFoo.Text + ". ");
  }
  protected void ddlBar_Changed(object sender, EventArgs e)
  {
      Response.Write("ddlBar changed to " + ddlBar.Text + ". ");
  }
  protected void btnQux_Changed(object sender, EventArgs e) { }
  </code></pre>
  
  <p>Now, say you change <code>ddlFoo</code> to <code>3</code> and then <code>ddlBar</code> to <code>b</code>. Then, you click <code>btnQux</code>. You get the following output from <code>Response.Write</code> after clicking:</p>
  
  <pre><code>ddlBar changed to b. ddlFoo changed to 3. 
  </code></pre>
  
  <p>Why does this happen? Do the <code>OnSelectedIndexChanged</code> methods get put into a stack to be called once a postback happens?</p>
  
  <p><b>B)</b> Why does my webpage load much more quickly when I use this approach and set <code>AutoPostBack="false"</code> for most of my controls? To be specific, I did this for a <code>
  CheckBox</code>, a <code>DropDownList</code>, and a <code>TextBox</code> in a <code>GridView</code>, which retrieved ~1200 rows and 27 columns of data and took 10s in VS2008 debug mode versus 310s before. Why would the load/refresh time be so much faster?</p>
  
  <p><b>EDIT:</b> I released the code earlier this afternoon, and there was no significant difference between the load time of the old (<code>AutoPostBack="true"</code>) and new (<code>AutoPostBack="false"</code>) versions. I think that perhaps the debugger was doing something extra, which caused the large jump in load time. A better way to rephrase question <b>B)</b> might be this then: What could the debugger have been doing to cause this large jump in load time?</p>