title: Autocomplete search box input field
body: <p>I am using JQuery for autocompleting the search textbox with my database. The problem rises when I want to access the text of the search textbox in query string since I am using html textbox. To make it in context, either I have to use <code>runat="server"</code> or I can use <code>asp:Textbox</code> but in both the cases my autocompleting feature stops working.</p>
  
  <p>Here is the aspx code:</p>
  
  <pre><code>&lt;div id="search-location-wrapper"&gt;
              &lt;input type="text" id="txtSearch" class="autosuggest" /&gt;
              &lt;div id="search-submit-container"&gt;
              &lt;asp:Button ID="btnSearch" runat="server" Text="Search" 
                        onclick="btnSearch_Click"&gt;&lt;/asp:Button&gt;
              &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>C# Code:</p>
  
  <pre><code>protected void btnSearch_Click(object sender, EventArgs e)
      {
          string location = txtSearch.ToString();  /*Here is the error: txtSearch is not in current context */
          int id = Convert.ToInt32(ddlCategory.SelectedValue);
          string url = "SearchResults.aspx?Id="+id+"&amp;location="+location;
          Response.Redirect(url);
      }
  </code></pre>