在这里,我需要isChecked
在 Dictionary 项目中添加值。
我尝试直接添加,但出现以下错误:
" CS1501: No overload for method 'Add' takes 1 arguments"*. Is there any alternate way to add ischecked in Idictionary.
我的代码是:
@{
bool val = false;
var isChecked = (val == true) ? new { @Checked = "checked" } : null;
}
@Html.RadioButtonFor(x => x.Status, "Male",new Dictionary<string,object>{{"id","GenderRdoButton"},{isChecked}})