title: OnClick/OnClientClick event with Asp.Net
body: <p>I am a little confused to use this script and how it actually works?</p>
  
  <p>Here is my script:</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
              $('#&lt;%=TextBox1.ClientID%&gt;').change(function () {
                  $('#various3').attr('href', $(this).val());
              });
  
  
                  $("#&lt;%=Button1.ClientID%&gt;").click(function (event) {
                      setTimeout(showStickySuccessToast, 1000);
                      function showStickySuccessToast() {
                          $().toastmessage('showToast', {
                              text: 'Finished taking Screenshot!',
                              sticky: false,
                              position: 'middle-center',
                              type: 'success',
                              closeText: '',
                              close: function () {
  
                              }
                          });
                      }
  
                  })                
          });
        &lt;/script&gt;
  </code></pre>
  
  <p>This is my button: </p>
  
  <pre><code>&lt;a id="various3" href="#"&gt;&lt;asp:Button ID="Button1" runat="server" 
      Text="Button" OnClientClick="Button1_Click"/&gt;&lt;/a&gt;
  </code></pre>
  
  <p>This is my code behind for button1_Click event:</p>
  
  <pre><code>Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
      Dim NewTh As New Threading.Thread(AddressOf DoIT)
      NewTh.SetApartmentState(Threading.ApartmentState.STA)
      NewTh.Start()
      ImgPreview.ImageUrl = "~/uploads/Sample.jpg"
  End Sub
  </code></pre>
  
  <p>Now if I click the button it should open the iframe and display the message which I am able to do.
  Now the problem is how do I call the button1_Click event which is in the codebehind at the same time. 
  I have used <code>OnClick</code> and <code>OnClientClick</code> event as shown below but it's not working and I'm not getting any errors.
  </p>