title: Slow UpdatePanel in ASP.NET application
body: <p>I was trying to figure out why my UpdatePanel is so SLOW (after Button1's postback) in an ASP.NET application:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="MyNamespace.WebForm1" %&gt;
  &lt;%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %&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;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
          &lt;cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"/&gt;
          &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"&gt;
          &lt;ContentTemplate&gt;
              &lt;asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /&gt;
          &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>code behind:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  namespace MyNamespace
  {
      public partial class WebForm1 : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
  
          }
  
          protected void Button1_Click(object sender, EventArgs e)//this is slow!!
          {
              Button btn = sender as Button;
              btn.Text = DateTime.Now.ToString("hhmmssfff");
          }
      }
  }
  </code></pre>
  
  <p>I was searching here in StackOverflow but I couldn't find a straight forward answer.
  Anyone knows something that might speed this up?</p>
  
  <p>I've seen a faster UpdatePanel button postback when I run my webapplication using <a href="http://Junior-PC" rel="nofollow">http://Junior-PC</a>. But when I use <a href="http://localhost" rel="nofollow">http://localhost</a> is pretty slower.</p>
  
  <p>The only difference between a regular web application and this one is in Web application properties-> <em>Web</em> tab-> <em>Servers</em> section where is marked <em>Use Local IIS Web Server</em>-> <em>Project Url</em>: <a href="http://localhost/" rel="nofollow">http://localhost/</a> and <em>Override application root URL</em>.</p>