Skip to content

Instantly share code, notes, and snippets.

@dgg
Created August 30, 2013 13:01
Show Gist options
  • Select an option

  • Save dgg/6389606 to your computer and use it in GitHub Desktop.

Select an option

Save dgg/6389606 to your computer and use it in GitHub Desktop.
Model binding dynamic collections. V template for new things
@model DgonDotNet.Blog.Samples.DynamicCollections.Models.AddViewModel
<script id="addable-template" type="text/x-handlebars-template">
<tr>
<td>
<div class="col-xs-4">
@(Html.Templated("{{NewIndex}}")
.TextBox(m => m.Things[0].Number, string.Empty, new { @class = "form-control input-sm" }))
</div>
</td>
<td>
<div class="col-lg-3">
@(Html.Templated("{{NewIndex}}")
.TextBox(m => m.Things[0].Text, string.Empty, new { @class = "form-control input-sm" }))
</div>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment