Skip to content

Instantly share code, notes, and snippets.

@buchizo
Created January 21, 2015 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buchizo/712fa2aeea2992614331 to your computer and use it in GitHub Desktop.
Save buchizo/712fa2aeea2992614331 to your computer and use it in GitHub Desktop.
@{
ViewBag.Title = "Index";
}
@model MvcApplication1.Models.HomeViewModel
<h2>Index</h2>
@using (Html.BeginForm("Index", "Home", FormMethod.Post))
{
<input type="submit" />
<table>
@foreach (var s in Model.People.Select((People, i) => new { People, i }))
{
<tr>
<td>
@Html.TextBoxFor(m => s.People.Name, new { Name = string.Format("People[{0}].Name", s.i), @id = string.Format("People[{0}].Name", s.i) })
</td>
</tr>
}
</table>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment