Tag
私は現在、次のように定義されたオブジェクトを持っています:
public class Tag
{
public string Name { get; set; }
}
これは、私が次のように定義しているモデルのコレクションプロパティです。
public class MyModel
{
public string Name { get; set; }
public IList<Tag> Tags { get; set; }
}
私の見解では、私は次のコードを持っています:
@using (Html.BeginForm())
{
<div>
@Html.LabelFor(m => m.Name)
@Html.TextBoxFor(m => m.Name)
</div>
<div>
<!--
Here I'd like a collection of checkbox inputs, where the selected names
get passed back to my controller via the IList<Tag> collection
-->
</div>
<input type="submit" value="Submit" />
}
モデルのIListコレクションを介して、チェックボックスグループ(コメントで指定)で選択したアイテムを返すにはどうすればよいですか?