私はradiobuttonforを動的に生成しています。 私のコードはここ動的に生成されるラジオボタンの名前を与える方法
@{int questionCount = 0;
}
@{foreach (SectionDetail sectionDetail in section.SectionDetails)
{
<table>
<tr>
<td>
@Html.Label(sectionDetail.Title)
</td>
@{count = 0;
}
@foreach (SectionScore sectionScore in Model.IndividualSections)
{
<td class="ColSupplier">
@Html.RadioButtonFor(model => model.IndividualSections[count].SectionScores[questionCount].score.pass, true)Pass
@Html.RadioButtonFor(model => model.IndividualSections[count].SectionScores[questionCount].score.pass, false)Fail
</td>
count++;
}
</tr>
</table>
questionCount++;
}
、として実行され、いくつかのラジオボタンは、同じ名前を持つています。だから私は正確な値を得ることができません。これらのラジオボタンに異なる名前を付ける方法。これを整理するのを手伝ってください。
ラジオボタンのグループ化が名前に基づいているため、これは機能しない可能性があります。バインドされたモデルは名前として機能します。したがって、同じ名前が2つ以上の行にバインドされています。グループ化は1つ以上の行に分類されます。グループ化を1行に制限する必要があります。 –