title: Asp.net: How to call a javascript function at the end of button click code behind
body: <p>My motto is to call a Java script function at the end of button click code behind. ie, firstly i need to execute the server side function after which my java script function should get invoked.</p>
  
  <p><strong>My server side method is as follows</strong> </p>
  
  <p>protected string SaveEmbedURL_click()</p>
  
  <p>{</p>
  
  <pre><code>    if (txtembedurl.Text != null)
      {
          School aschool = new School();
          aschool.SchoolId = CurrentSchool.SchoolId;
          aschool.EmbedUrl = txtembedurl.Text;
          SchoolRespository.updateEmbedUrl(aschool);
          return "true";
      }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>My Java script function is as follows</strong></p>
  
  <p>function SaveEmbedUrlClientSide() {</p>
  
  <pre><code>admin_CustomizeTheme.SaveEmbedURL_click(true);
  $('#lbl_embedcode').removeClass('hide').addClass('show');
  $('#embedCode').removeClass('hide').addClass('show');
  CopyToClipboard("embedCode");
  </code></pre>
  
  <p>}</p>
  
  <p>How can i achieve this?</p>
  
  <p>Thanks.</p>