title: ASP.NET MVC Passing form values to action method
body: <p>I have the following form</p>
  
  <pre><code>&lt;form name="SearchForm" method="post" id="SearchForm" action="/Search/"&gt;
  </code></pre>
  
  <p>And the following button</p>
  
  <pre><code>&lt;input type="button" onclick="javascript:document.SearchForm.submit();" class="btn-leftsearch"&gt;
  </code></pre>
  
  <p>On clicking this button, the form submits and calls this method</p>
  
  <pre><code>[HttpPost]
  public ActionResult Index(string querystring)
  {
     return View();
  }
  </code></pre>
  
  <p>Of course querystring is null.  I want to pass querystring or preferably something else representing the fields in the form to the controller.  I have tried playing with the action attribute in the form tag.  I have tried to add the data to the onclick method in the button.  Nothing is working.  All I want to do is pass some data like this</p>
  
  <pre><code>Search?pri=all&amp;amenity=pool etc
  </code></pre>
  
  <p>In the controller I would have something like</p>
  
  <pre><code>[HttpPost]
  public ActionResult Index(string pri, List&lt;string&gt; amenities)
  {
     ...
  }
  </code></pre>
  
  <p>Can someone tell me how I can pass this data to the view?</p>