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}})