Skip to content

Instantly share code, notes, and snippets.

@BlackFoks
Created March 11, 2010 15:45
Show Gist options
  • Save BlackFoks/329254 to your computer and use it in GitHub Desktop.
Save BlackFoks/329254 to your computer and use it in GitHub Desktop.
<div class="editor-label">
<%= Html.LabelFor(model => model.Authors) %>
</div>
<span id="authorChackboxes">
<% List<Author> authors = ViewData["authors"] as List<Author>;
foreach (Author author in authors)
{
string checkboxId = string.Format("author{0}", author.Id); %>
<input type="checkbox"
id="<%= Html.Encode(checkboxId) %>"
name="authorIds"
value="<%= Html.Encode(author.Id) %>" />
<label for="<%= Html.Encode(checkboxId) %>"><%= Html.Encode(author.Name) %></label> <br />
<% } %>
</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment