很简单的问题,但很难找到答案。我如何转换
<input type="radio" id="radAnswer" name="answer" value="@answer" />
到
@Html.RadioButtonFor(/*some sort of code in here*/)
提前致谢!
最佳答案
有点像
@Html.RadioButtonFor(x => x.answer, your value, new { @id= "radAnswer" , @class="any"})
对于新的属性定义,比如选中的单选按钮
new { Checked = "checked"}
关于c# - 将 <input> 更改为 @Html.RadioButtonFor?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35405253/