title: Why is my ASP.NET LinkButton not firing the OnClick="AddToCart_Click" event?
body: <p>I have been banging my head against the wall on this for a full day now. I'm working out of Apress's "Beginning ASP.NET E-Commerce in C#", in the case someone is familiar with the project. In chapter 10, we are working with the PayPal AddToCart and GoToCart functionality.
  This is the event that isn't firing:</p>
  
  <pre><code>    //Why is this not working?
  protected void AddToCartButton_Click1(object sender, EventArgs e)
  {
      string productID = Request.QueryString["ProductID"];
      ProductDetails pd = CatalogAccess.GetProductDetails(productId);
      string options = "";
      foreach (Control cnt in attrPlaceHolder.Controls)
      {
          if (cnt is Label)
          {
              Label attrLabel = (Label)cnt;
              options += attrLabel.Text;
          }
          if (cnt is DropDownList)
          {
              DropDownList attrDropDown = (DropDownList)cnt;
              options += attrDropDown.Items[attrDropDown.SelectedIndex] + "; ";
          }
      string productUrl = Link.ToProduct(pd.ProductID.ToString());
      string destination = Link.ToPayPalAddItem(productUrl, pd.Name, pd.Price, options);
      Response.Redirect(destination);
      }
  </code></pre>
  
  <p>Here is the LinkButton's code:</p>
  
  <pre><code>    &lt;p&gt;
      &lt;asp:LinkButton ID="AddToCartButton" runat="server" CausesValidation="False" OnClick="AddToCartButton_Click1"&gt;Add to Shopping Cart&lt;/asp:LinkButton&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>I have tried setting a breakpoint but the event is never reached. The LinkButton also causes a postback, but never fires the OnClick event.</p>
  
  <p>Any help would be much appreciated!</p>
  
  <p>Here's url: <a href="http://www.northarktest.net/edwards/balloonshop" rel="noreferrer">http://www.northarktest.net/edwards/balloonshop</a> </p>
  
  <p>It seems the click event is firing on the server, but while locally debugging.</p>