title: How to apply knockout binding in jquery popup dialog
body: <p>I have simple partial view in cshtml with simple view model, like this:</p>
  
  <pre><code>&lt;script type="text/html" id="@WebSite.Models.DialogTemplates.NewUser"&gt;
    &lt;div id="change-state"&gt;
      &lt;p&gt;First name: &lt;input data-bind="value: firstName" /&gt;&lt;/p&gt;
      &lt;p&gt;Last name: &lt;input data-bind="value: lastName" /&gt;&lt;/p&gt;
      &lt;p&gt;Full name: &lt;strong data-bind="text: fullName"&gt;&lt;/strong&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
      function AppViewModel() {
          this.firstName = ko.observable("");
          this.lastName = ko.observable("");
          this.fullName = ko.computed(function() 
          {
              return this.firstName() + " " + this.lastName();    
          }, this);
      }
      ko.applyBindings(new AppViewModel());
  &lt;/script&gt;
  </code></pre>
  
  <p>I show this partial view like popup dialog but I do not figure out how to call applyBindings. If I call this after define model, than applyBindings is call before create dialog and not work. I try this too. <a href="https://stackoverflow.com/questions/7342814/can-you-call-ko-applybindings-to-bind-a-partial-view">Can you call ko.applyBindings to bind a partial view?</a>     </p>
  
  <pre><code>    ko.applyBindings(new AppViewModel(), document.getElementById("change-state"));
  </code></pre>