title: How do i can modify List<Model> items from razor
body: <p>I have a RAZOR (ASP.NET MVC 3) and a model of type List.
  I want to modify any element from Model into Razor and after to post exactly the same model BUT to be updated with any value MODIFIED (if it was been modified).</p>
  
  <pre><code>        @foreach (var item in Model)
          {
          &lt;tr&gt; 
              &lt;td&gt;@Html.DisplayFor(modelItem =&gt; item.InputID)&lt;/td&gt;
  
              @if (@ViewBag.editFlag)
              {
                  &lt;td&gt;@Html.TextBoxFor(modelItem =&gt; item.InputName)&lt;/td&gt;
              }
              else
              {
                  &lt;td&gt;@Html.DisplayFor(modelItem =&gt; item.InputName)&lt;/td&gt;
              }  
          }
  </code></pre>
  
  <p>. I want to be saved for AJAX CALL the same model but modified if it has undergone some changes </p>
  
  <p>And my ajax call:</p>
  
  <pre><code>      $("#editButton").click(function () {
         $.ajax({
               type: "POST",
                  url: "@Url.Content("~/PhysicalInput/UpdatePhysicalInput")",
                  data: { 
                      jsonData: @Html.Raw(Json.Encode(@Model));  
                  },
                  cache: false,
                  success: function (html) 
                  {
                      if (html.Success) 
                      {
                           window.location.href="ViewList?editFlag=false";
                      }
                      else { }
                  },
                  error: function(e) {  }
          });
  </code></pre>
  
  <p>Thanks</p>