Html.RadioButtonListASP.NET MVC Futures中有一个扩展方法.有没有人找到强类型版本的代码RadioButtonListFor<T>.它在视图中看起来像这样:
<%= Html.RadioButtonListFor(model=>model.Item,Model.ItemList) %>
Run Code Online (Sandbox Code Playgroud) 我无法将默认单选按钮设置为"已选中"!我正在使用@ Html.RadioButtonFor:
<div id="private-user">
@Html.RadioButtonFor(m => m.UserType, "type1", new { @class="type-radio" , **@Checked="checked"** }) 1
</div>
<div id="proff-user">
@Html.RadioButtonFor(m => m.UserType, "type2", new { @class="type-radio" }) 2
</div>
Run Code Online (Sandbox Code Playgroud)
是否可以使用@ Html.RadioButtonFor设置单选按钮?
谢谢