I'm trying to make a radiobuttonlist in razor syntax so far I have come up with this
@foreach (var p in Model)
{
<div id="projectList" class="col-lg-5">
@Html.RadioButton("name", "1", false, new { onCLick = "ShowOption(this)", id = p.id.ToString() })
@Html.Label(p.id.ToString(), p.name)
</div>
}
but the label isn't associated with the radiobutton.