title: getting a search bar working using AJAX in ASP.net application
body: <p>im trying to get a sech bar going for searching though a table and only displaying the results based off the title . the program does give me any errors or exceptions but when i press the search button nothing happens.
  any help would be appreciated</p>
  
  <p>the code inside my view</p>
  
  <pre><code>       &lt;script&gt;
  $(document).ready(function () {
      getFileSharingsAjax(0)
  });
  function searchFileSharings() {
      var searchQuery = $("#txtSearch").val();
      getFileSharingsAjax(searchQuery);
  }
  function filterMovies() {
      $("#txtSearch").val("");
  
      getFileSharingsAjax("");
  }
  function getFileSharingsAjax(searchQuery) {
      $.ajax({
          type: "GET",
          url:"@Url.Action("GetFileSharingsAjax")",
          data: {
  
  searchQuery: searchQuery
      }, success:function(ViewResult){
          $("#ajax-files").html(ViewResult);
  }
  
  });
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>my controller class</p>
  
  <pre><code>     public ActionResult GetFileSharingsAjax(string searchQuery)
      {
          var query = from m in db.FileShare
                      select m;
          if (!string.IsNullOrEmpty(searchQuery))
          {
              query = query.Where(s =&gt; s.Title.Contains(searchQuery));
          }
  
          return View("Files", query.ToList());
      }
  </code></pre>
  
  <p>any help would be appreciated</p>