(Html.RadioButton) 有出路,但 (Html.RadioButtonFor) 没有出路-6ren">
gpt4 book ai didi

asp.net-mvc-2 - 如何将 ASp.net MVC 2 中的 RadioButtonFor() 设置为默认选中

转载 作者:行者123 更新时间:2023-12-03 06:56:30 24 4
gpt4 key购买 nike

如何将 RadioButtonFor() 设置为默认选中

<%=Html.RadioButtonFor(m => m.Gender,"Male")%>

(Html.RadioButton) 有出路,但 (Html.RadioButtonFor) 没有出路

有什么想法吗?

最佳答案

使用简单的方法:

<%= Html.RadioButtonFor(m => m.Gender, "Male", new { Checked = "checked" })%>

关于asp.net-mvc-2 - 如何将 ASp.net MVC 2 中的 RadioButtonFor() 设置为默认选中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2598668/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com