title: asp.net/VB.net: OnClientClick function shows up after postback
body: <p>I want to show a confirm dialog in my asp.net/VB.net application.</p>
  
  <p>I'm adding programmatically the OnClientClick method in the <code>Click</code> event of a buton.</p>
  
  <p>My code:</p>
  
  <pre><code>Protected Sub btn_send_Click(sender As Object, e As EventArgs) Handles btn_send.Click
          btn_send.OnClientClick = "return confirm('Proceed?');"
  End Sub
  </code></pre>
  
  <p>The dialog is displayed <strong>after the first postback</strong> of the site.</p>
  
  <p>After I've made a postback, the dialog shows up on every click. But when I'm callin the page without a postback, no dialog shows up and the page does its postback.</p>
  
  <p>Can anyone help?</p>