title: Cascading drop downs interfering with autocomplete textbox
body: <p>I have a page with an Ajax Toolkit tab container, a pair of cascading drop downs, and an autocomplete textbox. When I first open the page, if I click on the autocomplete textbox, the list of words/phrases drops down immediately. If I then click the first of the drop downs and then go back and click in the autocomplete textbox, nothing happens in that textbox. The words/phrases do not drop down. Can anyone help me figure out why this is happening, and how to make it not happen?</p>
  
  <p>In the aspx:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function () {
      BindControls();
  });
  function BindControls() {
      $("#txtSearch").autocomplete({
          source: function (request, response) {
              $.ajax({
                  url: "ServiceCS.asmx/GetScopes",
                  data: "{ 'sLookUP': '" + request.term + "' }",
                  dataType: "json",
                  type: "POST",
                  contentType: "application/json; charset=utf-8",
                  dataFilter: function (data) { return data; },
                  success: function (data) {
                      response($.map(data.d, function (item) {
                          return {
                              value: item,
                          }
                      }))
                  },
                  error: function (XMLHttpRequest, textStatus, errorThrown) {
                      alert(textStatus);
                  }
              });
          },
          select: function (e, i) {
              $("#&lt;%=txtScopeID.ClientID%&gt;").val(i.item.value);
          },
          minLength: 0,
          scroll: true
      }).focus(function(){
          $(this).autocomplete("search", "");
      })
  }
  &lt;/script&gt;
  ...
  &lt;ajaxToolkit:TabContainer ID="TabContainer1" runat="server" 
      TabStripPlacement="Top"&gt;
  &lt;ajaxToolkit:TabPanel runat="server" ID="JobPanel" HeaderText="Job Info"&gt;
  &lt;ContentTemplate&gt;
  &lt;asp:UpdatePanel ID="updatePanel1" runat="server"&gt;
  &lt;ContentTemplate&gt;
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td class="right_column"&gt;
      &lt;asp:DropDownList ID="ddlClient" AutoPostBack="true" 
          OnSelectedIndexChanged="ddlClient_SelectedIndexChanged" 
          runat="server"&gt;
      &lt;/asp:DropDownList&gt;
      &lt;ajaxToolkit:CascadingDropDown ID="cddlClient" runat="server" 
          Category="ClientID" LoadingText="Loading..." 
          PromptText="Select Client" ServiceMethod="GetClients" 
          ServicePath="~/ServiceCS.asmx" TargetControlID="ddlClient"&gt;
      &lt;/ajaxToolkit:CascadingDropDown&gt;
  &lt;/td&gt;
  &lt;td class="right_column"&gt;
      &lt;asp:DropDownList ID="ddlLoc" AutoPostBack="true" 
          OnSelectedIndexChanged="ddlLoc_SelectedIndexChanged" runat="server"&gt;
      &lt;/asp:DropDownList&gt;
      &lt;ajaxToolkit:CascadingDropDown ID="cdlLocs" runat="server" 
          Category="ClientLocationID" LoadingText="Loading..." 
          ParentControlID="ddlClient" PromptText="Select Location" 
          PromptValue="" ServiceMethod="GetLocations" 
          ServicePath="~/ServiceCS.asmx" TargetControlID="ddlLoc"&gt;
      &lt;/ajaxToolkit:CascadingDropDown&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td class="right_column"&gt;
      &lt;input type="text" value="" id="txtSearch" style="text-align:left; 
          width:300px;" /&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  &lt;/ContentTemplate&gt;
  &lt;/ajaxToolkit:TabPanel&gt;
  &lt;/ajaxToolkit:TabContainer&gt;
  </code></pre>
  
  <p>Services.asmx:</p>
  
  <pre><code>&lt;WebMethod()&gt; _
  Public Function GetClients(knownCategoryValues As String) As CascadingDropDownNameValue()
      Dim query As String = "SELECT ClientCode + ' | ' + ClientName"
      query &amp;= "     , ClientID"
      query &amp;= "  FROM view_ClientCombo"
      query &amp;= " ORDER BY ClientCode"
      Dim clients As List(Of CascadingDropDownNameValue) = GetData(query)
      Return clients.ToArray()
  End Function
  
  &lt;WebMethod()&gt; _
  Public Function GetLocations(knownCategoryValues As String) As CascadingDropDownNameValue()
      Dim client As String = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)("ClientId")
      'Dim query As String = String.Format("SELECT CliLocNumber FROM view_ClientLocation WHERE ClientID = {0}", client)
      Dim query As String = String.Format("SELECT CliLocNumber + ' | ' + CliLocCity + ' | ' + CliLocState, replace(CliLocName, '''', '''''') FROM dbo.view_ClientLocCombo WHERE ClientID = {0}", client)
      Dim locations As List(Of CascadingDropDownNameValue) = GetData(query)
      Return locations.ToArray()
  End Function
  
  Private Function GetData(query As String) As List(Of CascadingDropDownNameValue)
      Dim conString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
      Dim cmd As New SqlCommand(query)
      Dim values As New List(Of CascadingDropDownNameValue)()
      Using con As New SqlConnection(conString)
          con.Open()
          cmd.Connection = con
          Using reader As SqlDataReader = cmd.ExecuteReader()
              While reader.Read()
                  values.Add(New CascadingDropDownNameValue() With { _
                   .name = reader(0).ToString(), _
                   .value = reader(1).ToString() _
                  })
              End While
              reader.Close()
              con.Close()
              Return values
          End Using
      End Using
  End Function
  
  &lt;WebMethod()&gt; _
  Public Function GetScopes(ByVal sLookUP As String) As String()
      Dim scopes As New List(Of String)()
      Using conn As New SqlConnection()
          conn.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
          Using cmd As New SqlCommand()
              cmd.CommandText = "SELECT JobScopeDesc + ' | ' + JobScopeID AS JobScopeDesc FROM view_JobScopeCode where JobScopeDesc like '%' + @SearchText + '%' ORDER BY JobScopeDesc"
              cmd.Parameters.AddWithValue("@SearchText", sLookUP)
              cmd.Connection = conn
              conn.Open()
              Using sdr As SqlDataReader = cmd.ExecuteReader()
                  While sdr.Read()
                      scopes.Add(sdr("JobScopeDesc").ToString())
                  End While
              End Using
              conn.Close()
          End Using
          Return scopes.ToArray()
      End Using
  End Function
  </code></pre>
  
  <p>I've never used web methods or Jquery, I found these examples and made them work for me -- until I noticed this problem. Any help is greatly appreciated. </p>