title: ASp.NET MVC 4 RAZOR - Best way to create a search page
body: <p>I have a  search page using MVC4 with Razor. Details as bellow:</p>
  
  <ul>
  <li>Whole page is divided in to two part.</li>
  <li>Left panel contains total 5 search section like search by product, search by city etc. Each section have check box list. So user can select multiple option from each section.</li>
  <li><p>Search panel is a partial view with a submit button. As given below</p>
  
  <p>@using (Html.BeginForm("ModelsList", "Model"))
     {</p>
  
  <p></p>
  
  <pre><code>&lt;div class="ModelListSearch
  
   Panel" style="width: 309px; float: left"&gt;
          &lt;div class="heading"&gt;
              By Budget
  
              &lt;div class="clear"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;!--heading--&gt;
          &lt;ul&gt;
              @{
      for (int i = 0; i &lt; Model.BudgetDescription.Count; i++)
      {
                  &lt;li&gt;
                      @Html.HiddenFor(m =&gt; m.BudgetDescription[i].BudgetId)
                      @Html.HiddenFor(m =&gt; m.BudgetDescription[i].Description)
                      @Html.CheckBoxFor(m =&gt; m.BudgetDescription[i].Selected)@Model.BudgetDescription[i].Description
                  &lt;/li&gt;
      }
              }
  
          &lt;/ul&gt;
  </code></pre></li>
  <li><p>Action methods are as below</p>
  
  <p>public ActionResult ModelsList(int? brandId, int? bodyStyleId, int? fuelTypeId, int? 
            transmissionTypeId, int? budgetID)
      {</p>
  
  <pre><code>    // this is called when first time page is loaded
  
  }
  </code></pre>
  
  <p>[HttpPost]
  public void ModelsList(NewCarSearchContainer searchData)
  {
           // this is called on click of search button<br>
  }</p></li>
  <li><p>On click of search button search result is shown in right panel.</p></li>
  <li><p>When we click on search button it post whole search object (NewCarSearchContainer) to action method &amp; we find out the selected item from this object &amp; get data from DAL layer accordingly.</p>
  
  <p>This page is working fine <strong>BUT problem is that URL does not updated as per user selected search option. I think as we are using post it does not update url.</strong> We can not used GET as GET pass all check box item as query string header which has a specific limit.
  One option is using action link instead of submit button. But in that case i dont know how pass selected item of search panel to action method.
  We need to updated URL as per selected search option to optimize SEO.</p></li>
  </ul>