title: Making a button click and process using javascript with Asp.Net
body: <p>I'm having two buttons and one button is hidden.
  Now when I click the visible button I need to do two things </p>
  
  <p>1.Open Iframe.</p>
  
  <p>2.Automatically make the 2nd Button(Hidden)to be clicked.</p>
  
  <p>When the second button is clicked I need to display the message on top of the IFrame which I have mentioned as <code>function showStickySuccessToast()</code></p>
  
  <p>Now I am able to open IFrame but I'm unable to make the Hidden button clicked automatically.</p>
  
  <p>This is what I'm having:</p>
  
  <pre><code>      &lt;script type="text/javascript"&gt;
         $(document).ready(function(){
          $("#&lt;%=Button1.ClientID%&gt;").click(function(event){
              $('#&lt;%=TextBox1.ClientID%&gt;').change(function () {
                  $('#various3').attr('href', $(this).val());
              });
      });
         function showStickySuccessToast() {
          $().toastmessage('showToast', {
              text: 'Finished Processing!',
              sticky: false,
              position: 'middle-center',
              type: 'success',
              closeText: '',
              close: function () {
  
              }
          });
      }
      }) 
      &lt;/script&gt;
  </code></pre>
  
  <p>Here are my two buttons how I'm working with:</p>
  
  <pre><code>&lt;a id="various3" href="#"&gt;&lt;asp:Button ID="Button1" 
  runat="server" Text="Button" OnClientClick="Button2_Click"/&gt;&lt;/a&gt;
  
  &lt;asp:Button ID="Button2" 
  runat="server" Text="Button" Visible="False" OnClick="Button2_Click"/&gt;
  </code></pre>
  
  <p>And in the button2_Click event:</p>
  
  <pre><code>    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
         System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "Script", "showStickySuccessToast();", True)
      End Sub
  </code></pre>