title: jquery autocomplete lable value undefined in asp.net
body: <p>I am trying to display some cities in autocomplete using jquery and when any one selects the city then set the destination id to hidden field . i am using web service to get data for ajax call .</p>
  
  <p>here is my webservice method :</p>
  
  <pre><code> [WebMethod]
      [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
      public List&lt;BALDestinations&gt; AuotExtenderDestination(string destinationname)
      {
          DataSet ds=objDestination.GetDestination(destinationname);
          List&lt;BALDestinations&gt; result = new List&lt;BALDestinations&gt;();
          foreach (DataRow dr in ds.Tables[0].Rows)
          {
              BALDestinations b = new BALDestinations();
              b.City = dr["City"].ToString();
              b.DestinationId = dr["DestinationId"].ToString();
              result.Add(b);
          }
          return result;
      }
  </code></pre>
  
  <p>and this is the code of my  jquery autocomplete textbox extender </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          SearchText();
          $('#btnSearch').click(function () {
              alert($("#hiddenAllowSearch").val());
          });
      });  
      function SearchText() {
          $(".txtdest").autocomplete({
              //   source: $local_source,
              source: function (request, response) {
                  $.ajax({
                      type: "POST",
                      contentType: "application/json; charset=utf-8",
                      url: "WebService.asmx/AuotExtenderDestination",
                      data: "{'destinationname':'" + $('.txtdest').val() + "'}",
                      dataType: "json",
                      success: function (data) {
                        response(data.d);                      
                      },
                      error: function (result) {
                          alert("Error");
                      }
                  });
              },
              focus: function (event, ui) {
                  $(".txtdest").val(ui.item.label);
                  return false;
              },
              select: function (event, ui) {
                  $(".txtdest").val(ui.item.label);
                  $("#hiddenAllowSearch").val(ui.item.value);
                  return false;
              }
          });
      } 
  &lt;/script&gt;
  </code></pre>
  
  <p>undefined appear in text box when we type anything there </p>