MVC 4 Custom template for bool (razor)

后端 未结 4 1553
夕颜
夕颜 2021-02-07 09:37

I am using the twitter bootstrap framework, so to get the EditorFor and DisplayFor methods to output what I need, I created custom templates for each of the types like string, t

4条回答
  •  情歌与酒
    2021-02-07 10:21

    You could change your model so it accepts the null values as "yes"/"no"

    public bool? RememberMe { get; set; }
    

提交回复
热议问题