title: How to call a javascript function in C#
body: <p>I want to store form details and display a popup box, when I click the submit button. For this I use <code>try { } finally { }</code> but how to link popup box function in JavaScript to the C# file?</p>
  
  <p>JavaScript:</p>
  
  <pre><code>&lt;script&gt;
  function xpopup() {
      document.getElementById("x").onclick = function () 
      {
          var overlay = document.getElementById("overLay");
          var popup = document.getElementById("xPopup");
          overlay.style.display = "block";
          popup.style.display = "block";
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>C#:</p>
  
  <pre><code>try { }
  finally
  {
      ScriptManager.RegisterClientScriptBlock(this, GetType(), "none", "&lt;script&gt;function xpopup();&lt;/script&gt;", false);
  }
  </code></pre>