在我看来,我创建了一个动态单选按钮,其示例代码如下..
@for (int i = 0; i < Model.ChManufacturer.Count(); i++)
{
if (@Model.ChManufacturer[i].Text == "Select ...")
{
}
else
{
<td> <input id="manufacturer:@Model.ChManufacturer[i].Text" type="radio" name="Manu_rbgrp" value="@Model.ChManufacturer[i].Text"> @Model.ChManufacturer[i].Text
</td>
}
}
但我需要获取选定的单选按钮值。如何获取选中的单选按钮的值。例如:O abc、O bbc、O ccc。所以如果我选择第二个选项意味着它的价值是 bbc。有答案吗???我在运行时得到以下输出
<td>
<input id="manufacturer:GLI-List" type="radio" value="GLI-List" name="Manu_rbgrp">
GLI-List
</td>
<td>
<input id="manufacturer:Latham-List" type="radio" value="Latham-List" name="Manu_rbgrp">
Latham-List
</td>
<td>
<input id="manufacturer:Loop-Loc-List" type="radio" value="Loop-Loc-List" name="Manu_rbgrp">
Loop-Loc-List
</td>
<td>
<input id="manufacturer:Merlin-List" type="radio" value="Merlin-List" name="Manu_rbgrp">
Merlin-List
</td>