Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Is it possible to see what your view code look like?</p> <p>It should look something like this:</p> <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage&lt;IEnumerable&lt;Employee&gt;&gt;" %&gt; // Other code not in your example &lt;%using (Html.BeginForm("MeetingTodo", "OA", FormMethod.Post, new { id = "TaskForm" })) {%&gt; &lt;%=Html.Hidden("id",ViewContext.RouteData.Values["id"]) %&gt; &lt;div class="container"&gt; &lt;% for (int i = 0; i &lt; Model.Count(); ++i) { %&gt; &lt;div class="grdrow" &gt; &lt;div class="grdrightcaption" style="width:173px;" &gt; &lt;%= Model[i].setupEmployee.EmployeeName%&gt; &lt;/div&gt; &lt;div class="grdcells" &gt; &lt;%= Html.TextAreaFor(x =&gt; x[i].Todo, new { maxlength = 200, style="width:300px;" })%&gt; &lt;%= Html.HiddenFor(x =&gt; x[i].EmployeeID)%&gt; &lt;/div&gt; &lt;div class="grdcells" style="width:50px;" &gt; &lt;%=Html.CheckBoxFor(x =&gt; x[i].Required) %&gt; &lt;/div&gt; &lt;/div&gt; &lt;% }%&gt; &lt;/div&gt; &lt;br /&gt; &lt;button type="submit" class="button"&gt;save&lt;/button&gt; &lt;%}%&gt; // Other code not in your example </code></pre> <p>And your action method signature should look like this:</p> <pre><code>public ActionResult MeetingTodo(IEnumerable&lt;Employee&gt; Employees, FormCollection collection, int id) </code></pre> <p>I don't remember of the top of my head if you can set the type to <code>IEnumerable&lt;Employee&gt;</code> or if you have to set it to <code>Employee[]</code> in the action method signature, but one or the other should work.</p> <p>Also note that on the first line you have to make sure you include the namespace in the Inherits attribute as such: <code>System.Web.Mvc.ViewPage&lt;IEnumerable&lt;Namespace1.Namespace2.Namespace3.Employee&gt;&gt;</code> and of course use whatever real name your employee class has.</p> <p>Hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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