I am building my first Razor app and really loving it. I am trying to get the low-down on how to create an editor template that renders out an editable list of items without a foreach loop. Is this possible?
Here are the basics of what I am trying to achieve:
In my view (Views/Image/Homepage.cshtml) I have:
@model List<MyNameSpace.Image>
@{
ViewBag.Title = "Homepage Images";
}
@*????*@
@Html.EditorFor(Model => Model)
And in my editor template (Views/Image/EditorTemplates/Image.cshtml??) I have:
@model MyNameSpace.Image
<div>@Html.TextBoxFor(Model => Model.Title)</div>
<div>@Html.TextBoxFor(Model => Model.LongDescription)</div>
LOL this is embarrassing but worthy of mentioning, the code above works fine, I created a test list in the controller but forgot to pass it to the view :-D