title: Knockout dropdownlist databind is not working in ajax call
body: <p>I try to bind a dropdownlist in knockout with MVC 4. Here is my code:</p>
  <p><strong>Action</strong></p>
  <pre><code>    public JsonResult GetUserTypes()
      {
          using (QuestApplicationEntities db = new QuestApplicationEntities())
          {
              var usertypes = (from usertype in db.UserTypes
                               select new
                               {
                                   usertype.Id,
                                   usertype.Name
                               }).ToArray();
  
              return Json(usertypes, JsonRequestBehavior.AllowGet);
          }
      }
  </code></pre>
  <p><strong>Knockout.js</strong></p>
  <pre><code>var Register =
  {
      Name: ko.observable(&quot;Ragesh&quot;),
      Email: ko.observable().extend({ email: true }),
      Password: ko.observable(),
      UserTypes: ko.observableArray([]),
  
      UserType: ko.observable(),
  
      SaveRegistration: function () {
          //alert('saved');
          $.ajax({
              url: '/Home/RegisterUser',
              type: 'post',
              datatype: 'json',
              data: ko.toJSON(this),
              contentType: 'application/json',
              success: function () {
                  alert('saved');
              }
          });
      }
  };
  
  $.ajax({
              url: '/Home/GetUserTypes',
              type: 'post',
              datatype: 'json',
              data: ko.toJSON(this),
              contentType: 'application/json',
              success: function () {
                  ko.mapping.fromJS(data,Register.UserTypes);
          }
      });
  
      ko.applyBindings(Register);
  </code></pre>
  <p><strong>Html</strong></p>
  <pre><code>  &lt;h4&gt;Register&lt;/h4&gt;
   &lt;fieldset&gt;
  &lt;legend&gt;New User Registration&lt;/legend&gt;
  &lt;div class=&quot;editor-label&quot;&gt;
      Name 
  &lt;/div&gt;
  &lt;div class=&quot;editor-field&quot;&gt;
      &lt;input data-bind=&quot;value:Name&quot; /&gt;
  &lt;/div&gt;
  &lt;div class=&quot;editor-label&quot;&gt;
      Email 
  &lt;/div&gt;
  &lt;div class=&quot;editor-field&quot;&gt;
      &lt;input data-bind=&quot;value:Email&quot; /&gt;
  &lt;/div&gt;
  &lt;div class=&quot;editor-label&quot;&gt;
      User Type 
  &lt;/div&gt;
  &lt;div class=&quot;editor-field&quot;&gt;
      &lt;select data-bind=&quot;options: UserTypes, value: UserType, optionsCaption: 'Select User Type...'&quot;&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  &lt;p&gt;
      &lt;button type=&quot;button&quot; data-bind=&quot;click:SaveRegistration&quot;&gt;Register&lt;/button&gt;
  &lt;/p&gt;
  &lt;/fieldset&gt;
  &lt;script src=&quot;~/Scripts/knockout-2.2.1.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;~/Scripts/knockout.validation.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;~/Scripts/App/Register.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>But the GetUserTypes action is not fired.</p>
  <p>And there is another error show in the Firebug.</p>
  <p><img src="https://i.stack.imgur.com/9Dc0u.jpg" alt="enter image description here" /></p>