title: Is there any way to run Handlebar Register helper after Handlebars.Compile
body: <p>I am creating inline editable form using HandleBars template, Everything is working fine but issue is i have some programs in database table and from there all active programs would be brought. Once user clicks to edit the course editable template is brought via <code>GET</code> request and compiled but i have to populate the select dropdown of the all active programs it would do <code>ajax</code> call and bring all the active programs so at this point i do not know how to run the Handlebars RegisterHelper to populate the data and  <code>set the selected value to edit the program</code> because the template has been compiled and executed already before ajax call The code i have written is as :
  This will run and bring the template, after bringing the template it will compile and execute it. </p>
  
  <pre><code>  $(document).on("click", "#span", function () {
              $.get('/User/code/editbasicinfo.html', function (data) {
  
                  $("#editabledata").append(data);
                  var source = $("#some-template").html();
                  var template = Handlebars.compile(source);
                  var data = JSON.parse($('#JsonData').val());
                  $("#editabledata").html(template(data));
  
  
              })
  
          });
  </code></pre>
  
  <p>when everything is compiled and appended it will call the template's <code>document.ready method</code> which is as </p>
  
  <pre><code>$(document).ready(function () {
      $.ajax({
          type: "POST",
          contentType: "application/json; charset=utf-8",
          url: "ViewUserCourse.aspx/getdropdown",
          data: "{}",
          dataType: "json",
          success: function (data) {
  
              $("#Program").append(data.d);
              Handlebars.registerHelper("selected", function (foo, bar) {                  
                  return foo == bar ? "selected" : "";
              });
          },
          error: function (result) {
              alert("Error");
          }
      });
  
      $('#datashown').hide();     
  });
  </code></pre>
  
  <p>this call will bring this json</p>
  
  <pre><code> &lt;option {{selected prog '0' }} value='0'&gt;- Select -&lt;/option&gt;&lt;option {{selected prog 'ABC' }} value='ABC'&gt;ABC&lt;/option&gt;&lt;option {{selected prog 'DEF' }} value='DEF'&gt;DEF&lt;/option&gt;"
  </code></pre>
  
  <p>at this point i would like to execut RegisterHelper named <code>selected</code> to set the selected value</p>