title: calling __dopPostback from javascript where target control is an ASP.Net custom control
body: <p>I need to pop up a jquery dialog as confirmation before a submit happens. I don't want the dialog to always pop up, that depends upon the setting of a dropdown.</p>
  
  <p>The submitting control (which I can't change by the way) is a custom control with a save and a cancel button and handlers for the save and cancel buttons.</p>
  
  <p>So when the user has selected a particular item from the drop down I hook up the click event (on the clientside) of the save button (that has been rendered by the custom control) to a js function using jQuery, that calls my showDialog() function and then returns false (to prevent the postback).</p>
  
  <p>I now need, when the user clicks the yes button on the dialog, to call __doPostBack to get the SaveButtons serverside events to fire and to get the serverrside validation to run.</p>
  
  <p>I've got </p>
  
  <pre><code>eval($("#&lt;%= hdnBtnPostback.ClientID %&gt;").val());
  </code></pre>
  
  <p>in the handler for the Yes button on the dialog.</p>
  
  <p>The hdnPostBack field contains the result of:</p>
  
  <pre><code>Page.ClientScript.GetPostBackEventReference(mySaveCancelCustomControl, String.Empty)
  </code></pre>
  
  <p>Unsuprisingly this isn't working.  The mySaveCancelCustomControl is the custom control mentioned above and it has two buttons that are rendered with two event handlers so the GetPostBackEventReference is doomed to fail.</p>
  
  <p>Any ideas what I should do?</p>