title: Button click event fires only once .NET
body: <p>The first time the button is pressed, the eventhandler is called and a popupwindow appears. After exiting that popupwindow, the second time the button is clicked, the eventhandler isn't called at all. I have debugged the code quite a bit without finding anything 'statewise' that should ruin the code, thus only providing this brief bit of code. Please tell me if you believe more resources are needed to pinpoint this problem.</p>
  
  <pre><code>     &lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ReferenceControl.ascx.cs" Inherits="DynamicForm.DynamicGenerator.Controls.ReferenceControl" %&gt;
      &lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %&gt;
  
      &lt;%@ Register Src="~/DynamicGenerator/Controls/SearchControl.ascx" TagName="SearchControl" TagPrefix="dyncontrols" %&gt;
  
      &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional"&gt;&lt;ContentTemplate&gt;
      &lt;asp:HyperLink ID="link" runat="server"&gt;&lt;/asp:HyperLink&gt;&amp;nbsp;&lt;asp:Button ID="btn" runat="server" Text="Välj" onclick="btn_Click" /&gt;
      &lt;/asp:Panel&gt;
  &lt;ajaxToolkit:ModalPopupExtender ID="popUpControl" runat="server" TargetControlID="popupDummyTarget" PopupControlID="pnlSearch" BackgroundCssClass="modalBackground"&gt;
  &lt;/ajaxToolkit:ModalPopupExtender&gt;
  
  protected void btn_Click(object sender, EventArgs e)
      {
          ShowSearch();
      }
  
  void ShowSearch()
      {
                      //some stuff
          popUpControl.Show();
      }
  </code></pre>
  
  <p><strong>How can I make my button listen to my requests?</strong></p>
  
  <p>I have tried adding DataBind() in the eventhandler, unfortunatly that didn't work. </p>
  
  <p>UPDATE1:
  The second click generates this error in firebug:</p>
  
  <p>uncaught exception: [Exception... "'Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument. Event validation is enabled using  in configuration or &lt;%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "JS frame :: chrome://firebug/content/spy.js :: callPageHandler :: line 744" data: no]</p>