title: Mvc Razor Listing and editing in same view with submit button for every list item
body: <p>I am new to MVC Razor please help me to implement this, 
  I have MVC Razor view
  I need to implement Listing and editing in the same view
  In the view, there is a List which will list the records from a collection</p>
  
  <pre><code>@foreach (var item in Model.IncidentListmodel). 
  </code></pre>
  
  <p>The list contains TextArea, Button for each record. </p>
  
  <pre><code>@Html.TextAreaFor(modelItem =&gt; item.Note, 2, 20, new { maxlength = 50 })
  
  &lt;input type="button" title="Save" value="Save" onclick="location.href='@Url.Action("Updateinc", "Incident", new { id = item.Id, name = item.Name, note = item.Note})'" /&gt;
  </code></pre>
  
  <p>My purpose is for each list item record,  User should be able to edit the content which is populated in the Text area and modify the content and can save (that particular record) with the corresponding button.</p>
  
  <p><strong>More Details:</strong></p>
  
  <p>Below are the details of I am trying to implement
  Each list item contains a Text area (data listing here properly) and a button for each. While tap on the button the new content in the text area (which I modified from UI) should be updated (I can write the update code). But while taping on the button, after changing the content of text area, the controller it is getting the old value only.</p>
  
  <p><strong>View:</strong></p>
  
  <pre><code>&lt;table&gt;
      @foreach (var item in Model.IncidentListmodel)
      {
          string class1 = item.Id % 2 == 0 ? "orangeRaw" : "blueRaw";
          &lt;tr class="@class1"&gt;
              &lt;td&gt;@Html.DisplayFor(modelItem =&gt; item.Name)&lt;/td&gt;
              &lt;td&gt;@Html.DisplayFor(modelItem =&gt; item.Title)&lt;/td&gt;
              &lt;td&gt;
                  @Html.TextAreaFor(modelItem =&gt; item.Note, 2, 20, new { maxlength = 50 })
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="button" title="Save" value="save" onclick="location.href='@Url.Action("Updateinc", "Incident", new { id = item.Id, name = item.Name, note = item.Note})'" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      }
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>public ActionResult Updateinc(int id,string name,string note,int? status )
  {
      return View();
  }
  </code></pre>