Skip to content

Instantly share code, notes, and snippets.

@Rookian
Created January 15, 2013 21:04
Show Gist options
  • Save Rookian/4542057 to your computer and use it in GitHub Desktop.
Save Rookian/4542057 to your computer and use it in GitHub Desktop.
@using (Html.BeginForm("PostData", "Home", FormMethod.Post))
{
@(Html.Grid(Model.Items)
.RenderUsing(new PostAsListRenderer<ItemModel>("list"))
.Columns(c =>
{
c.Custom(
@<text>
@Html.HiddenFor(x => item.Id)
@item.Id
</text>).Named("Id");
c.For(x => Html.TextBoxFor(y => x.Name)).Named("Name");
c.For(x => Html.TextBoxFor(y => x.Description)).Named("Description");
c.For(x => Html.DropDownListFor(y => x.SelectedItem, Model.SelectListItems)).Named("DropDown");
}))
<input type="submit" value="submit" />
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment