title: LinkButton OnCommand or OnClick Not Firing
body: <p>I'm trying to do something that seems to be fairly simple. I have a user control with several <code>LinkButtons</code>. Each <code>LinkButton</code> has <code>OnCommand</code>, <code>CommandName</code> and <code>CommandArgument</code> set, like so:</p>
  
  <pre><code>&lt;ul id="continents"&gt;
      &lt;li id="northamerica"&gt;&lt;asp:LinkButton ID="lbNorthAmerica" OnCommand="ChooseRegion" CommandName="SetCookie" CommandArgument="North America" runat="server"&gt;North America&lt;/asp:LinkButton&gt;&lt;/li&gt;
      &lt;li id="southamerica"&gt;&lt;asp:LinkButton ID="lbSouthAmerica" OnCommand="ChooseRegion" CommandName="SetCookie" CommandArgument="South America" runat="server"&gt;South America&lt;/asp:LinkButton&gt;&lt;/li&gt;
      &lt;li id="asia"&gt;&lt;asp:LinkButton ID="lbAsia" OnCommand="ChooseRegion" CommandName="SetCookie" CommandArgument="Asia" runat="server"&gt;Asia&lt;/asp:LinkButton&gt;&lt;/li&gt;
      &lt;li id="australia"&gt;&lt;asp:LinkButton ID="Australia" OnCommand="ChooseRegion" CommandName="SetCookie" CommandArgument="Australia" runat="server"&gt;Australia&lt;/asp:LinkButton&gt;&lt;/li&gt;
      &lt;li id="africa"&gt;&lt;asp:LinkButton ID="lbAfrica" OnCommand="ChooseRegion" CommandName="SetCookie" CommandArgument="Africa" runat="server"&gt;Africa&lt;/asp:LinkButton&gt;&lt;/li&gt;
      &lt;li id="europe"&gt;&lt;asp:LinkButton ID="lbEurope" OnCommand="ChooseRegion" CommandName="SetCookie" CommandArgument="Europe" runat="server"&gt;Europe&lt;/asp:LinkButton&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>For what it's worth, the user control has <code>AutoEventWireup="true"</code>.</p>
  
  <p>In the codebehind, I have this:</p>
  
  <pre><code>    protected void ChooseRegion(object sender, CommandEventArgs e)
      {
          Response.Cookies["region"].Value = e.CommandArgument.ToString();
          Response.Cookies["region"].Expires = DateTime.Now.AddDays(90);
          SendToRegion(e.CommandArgument.ToString());
      }
  </code></pre>
  
  <p>In my production environment (Windows Server 2008), <code>ChooseRegion()</code> is not getting called when I click on the link buttons, and thus no cookie is being set. I'm at a loss to figure out why. I've tried manually configuring the Command handlers in <code>OnInit</code> and tried using <code>OnClick</code> instead of <code>OnCommand</code>. I tried setting <code>EnableViewState="true"</code> on the <code>LinkButtons</code>. Nothing I've tried thus far has worked.</p>
  
  <p>However, this works fine on my development machine (Windows 7).</p>
  
  <p>I feel fairly certain at this point that there is probably some configuration difference between the two environments that is causing this, but I'm really not sure where to start looking. Ideas?</p>
  
  <p><strong>Edit - 2011-10-26:</strong></p>
  
  <p>OK - I've discovered I'm having this problem elsewhere as well. The site with the above code and the other site where I'm having the issue are both Sitecore solutions sharing the same Sitecore instance.</p>
  
  <p>On the other site, there is an textbox for an email address and an associated ImageButton with an OnClick event. This is all in a control that is being included on every page on the site. On the home page, the OnClick handler never fires. On any other page, the OnClick handler DOES fire.</p>
  
  <p>The code in the original part of my post above is also on the home page of the site. If I move it to any other page, it works as expected.</p>
  
  <p>Also, like the code in the original part of my post, it works fine on my development machine (Windows 7) but not on the production machines (Windows 2008 Server). So, it would seem that this seems to have something to do with being on the home page, and perhaps Sitecore is involved in the problem somehow. I'm still scratching my head, though ...</p>