I have following fields Db table , I want populate those values in check boxes
public Nullable<bool> Report_Users { get; set; }
public Nullable<bool> Innovation_Discussion_User { get; set; }
this is specific row in above table
I'm expecting ,
- empty check box if Values are
NULL
orFALSE
- checked check box if values are
TRUE
this is the syntax I've been used ,
@Html.CheckBox("Report User", Model == null ? false : (Model.Report_Users == Model.Report_Users ? true : false), new { @value = "false" }) Report User
@Html.CheckBox("Innovation Discussion User", Model == null ? false : (Model.Innovation_Discussion_User == Model.Innovation_Discussion_User ? true : false), new { @value = "false" }) Innovation Discussion User
but this seems not poplate correct values,
both check boxes showing checked always
Aucun commentaire:
Enregistrer un commentaire