title: How to set an input textbox with the result from an ajax call
body: <p>Need to autopopulate firstname and last name textbox with results from ajax call. Here is aspx web form:        </p>
  
  <pre><code>       &lt;input id="firstName" type="text" size="26"  maxlength="20" name="firstName" tabindex="2" /&gt;                           
        &lt;input id="lastName" type="text" value="" size="26" maxlength="20" name="lastName" tabindex="4" /&gt;
  </code></pre>
  
  <p>here is the jquery script with ajax call:</p>
  
  <pre><code>  &lt;script&gt;
      $("#lifeNumber").on('focusout', function (evt) {
          var options = {};
          options.url = "pcfform.aspx/GetEmployees";
          options.data = JSON.stringify({ lifeNumber: $(evt.target).val()  });
          options.type = "POST";
          options.dataType = "json";
          options.contentType = "application/json";
          options.success = function (result) {
             //need help here
  
              }
          };
          options.error = function (xhr, status, err) {
              alert(err);
          };
          $.ajax(options);
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Here is the WebMethod in aspx:</p>
  
  <pre><code>       public class Employee
         {
           public string FirstName { get; set; }
           public string LastName { get; set; }
         }
  
      [WebMethod]
      public static List&lt;Employee&gt; GetEmployees(string lifeNumber)
      {
          PCF.Entities.Data.Entities db = new PCF.Entities.Data.Entities();
          var data = db.MasterTables
                      .Where(x =&gt; x.Life_Hosp == lifeNumber)
                      .Select(x =&gt; new Employee
                      {
                          FirstName = x.FirstName,
                          LastName = x.LastName
                      });
          return data.ToList();
      }
  </code></pre>