Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要设置@html.radiobutton 真实状态。我有两个单选按钮。一种是真实状态,另一种是虚假状态。我怎么做?
你可以有一个视图模型:
public class MyViewModel { public bool Status { get; set; } }
和您视图中的 2 个 RadioButtons:
@Html.RadioButtonFor(x => x.Status, "true") @Html.RadioButtonFor(x => x.Status, "false")