Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You have your bindings wrong, You can start with this sample binding, sorry if there is any typo, I am typing in the editor itself.</p> <p><strong>Updated:</strong></p> <p>Your Partial:</p> <pre><code>&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;IEnumerable&lt;SaveStudentInvoice.Models.vwStudent&gt;&gt;" %&gt; &lt;table&gt; &lt;tr&gt; &lt;th&gt; Student ID &lt;/th&gt; &lt;th&gt; Past Due Amount &lt;/th&gt; &lt;th&gt; Past Due Days &lt;/th&gt; &lt;/tr&gt; &lt;% if (Model != null) for (int i = 0; i &lt; Model.Count(); i++) { %&gt; &lt;tr&gt; &lt;td&gt; &lt;%=Html.TextBoxFor(m=&gt;m.ToList()[i].StudentID) %&gt; &lt;/td&gt; &lt;td&gt; &lt;%=Html.TextBoxFor(m=&gt;m.ToList().ToList()[i].PastDueAmount) %&gt; &lt;/td&gt; &lt;td&gt; &lt;%=Html.TextBoxFor(m=&gt;m.ToList()[i].PastDueDays) %&gt; &lt;/td&gt; &lt;/tr&gt; &lt;% } %&gt; &lt;/table&gt; </code></pre> <p>You Main View:</p> <pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt; &lt;div&gt; &lt;% using(Html.BeginForm("Index","Home")) %&gt; &lt;% { %&gt; &lt;div&gt; &lt;% Html.RenderPartial("Partial",Model); %&gt; &lt;/div&gt; &lt;br/&gt; &lt;input type="submit" id="Submit" name="Submit" value="Submit" /&gt; &lt;% } %&gt; &lt;/div&gt; &lt;/asp:Content&gt; </code></pre> <p>You Controller:</p> <pre><code>public ActionResult Index() { List&lt;vwStudent&gt; students = new List&lt;vwStudent&gt;(); students.Add(new vwStudent() { PastDueAmount = 100, PastDueDays = "None", StudentID = "ooooo" }); students.Add(new vwStudent() { PastDueAmount = 102, PastDueDays = "No", StudentID = "Sollina" }); return View(students); } [HttpPost] public ActionResult Index(List&lt;vwStudent&gt; studentModel) { return View(studentModel); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload