title: How to call an action method using jquery and pass search string to action method
body: <p>I need to pass search string to action method.</p>
  
  <p><strong><em>View:</em></strong></p>
  
  <pre><code>&lt;div&gt;
    &lt;input id="search" type="text" placeholder="Search"&gt;
    &lt;div id="submitButton"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;script type="text/javascript"&gt;
  $("#submitButton").click(function () {
      var options = {};
      options.url = "/Section/Search";
      options.type = "POST";
      options.data = JSON.stringify({ t: $("#search").val() });
      options.contentType = "application/json";
      options.dataType = "json";
      $.ajax(options);
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I need to call this action method and take search string.</p>
  
  <p><strong><em>Controller:</em></strong> Section/Search</p>
  
  <pre><code>[HttpGet]
  public ActionResult Search(string SearchResults)
  {
      using (var db = new LambertonEntities())
      {
          var article = db.News.ToList();
          return View(article);
      }
  }
  </code></pre>