首页 新闻 会员 周边

@Html.CheckBoxFor(m => m.Snel >= 0?true:false)

0
悬赏园豆:10 [已关闭问题] 关闭于 2016-09-07 15:27

求解,报错如下

Additional information: Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.

不要问我从哪里来123的主页 不要问我从哪里来123 | 初学一级 | 园豆:6
提问于:2016-03-16 16:04
< >
分享
所有回答(1)
0

你看看CheckBoxFor怎么用,m.Snel设置id和name的

按照下面这种写法改一下试试

@if(model.Snel>=0){ @Html.CheckBoxFor(model => model.Snel, new { @checked = true }) } else { @Html.CheckBoxFor(model => model.Snel, new { @checked = false }) }

心怀宇宙 | 园豆:643 (小虾三级) | 2016-03-16 16:31
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册