title: Having two forms with single model in ASP.Net MVC
body: <p>I have two form in my view. One form searching records. One form for Goto page {number of page} to support pagination. As almost everyone suggested in <a href="https://stackoverflow.com/questions/15788806/asp-net-mvc-4-multiple-post-via-different-forms">similar question</a>, I must create two separate action for every form. It will make my work very easy, but I have problem when using these approach.</p>
  
  <p>Assume I have following model:</p>
  
  <pre><code>public class MyModel
  {
      public string Name { get; set; }
      public string DateOfEmployment { get; set; }
  
      public int? PageNumber { get; set; }
  
  }
  </code></pre>
  
  <p>And following view:</p>
  
  <pre><code>@model WebApplication1.Models.MyModel
  
  @using (Html.BeginForm("Index", "Home", FormMethod.Post, new { }))
  {
  
  
      @Html.LabelFor(m =&gt; m.DateOfEmployment)
      @Html.EditorFor(m =&gt; m.DateOfEmployment)
  
      @Html.LabelFor(m =&gt; m.Name)
      @Html.TextBoxFor(m =&gt; m.Name)
  
      &lt;input type='Submit' value='Search' /&gt;
  
  }
  
  &lt;!-- Rows goes here--&gt;
  
  
  @using (Html.BeginForm("Pagination", "Home", FormMethod.Post, new { }))
  {
  
  
      @Html.LabelFor(m =&gt; m.PageNumber)
      @Html.TextBoxFor(m =&gt; m.PageNumber)
  
      &lt;input type='Submit' value='Go' /&gt;
  
  }
  </code></pre>
  
  <p>The problem is when user click <code>Go</code> button, <strong>how can I know that what is search field values to recreate model rows?</strong>. If I use single form, I don't know which button clicked (in a clean way). So what should I do in these situation?</p>