title: Calling JavaScript function from [WebMethod]
body: <p>I need to call a JavaScript function that shows a Bootstrap modal. I have the following code:</p>
  
  <pre><code>[System.Web.Services.WebMethod()]
  [System.Web.Script.Services.ScriptMethod()]
  public static void execModal(string groupname, int zw) { 
      //need to generate the data first
      StringBuilder sb = new StringBuilder();
      Generate gen = new Generate();
      sb = gen.generateDeeperTable(zw, groupname);
  
      //insert into my placeholder
      //Append the HTML string to Placeholder.
      fillPH(sb);
  
      //run javascript function &lt;showModel&gt; to show the modal
  
  }
  </code></pre>
  
  <p>Here is how I call the execModal method form JS:</p>
  
  <pre><code>    &lt;script type="text/javascript&gt;
         function callGenDeeperTable(zw, groupname) {
  
            PageMethods.execModal(groupname, zw);
         }
     &lt;/script&gt;
  </code></pre>
  
  <p>The function <code>execModal</code> is called from a javascript function in the .aspx site.</p>
  
  <p>How can I call the javascript function <code>showModal</code>?</p>