【发布时间】:2010-06-17 14:13:43
【问题描述】:
我刚刚开始发现 FluentHml,我被 CheckBoxList Helper 卡住了。
这里是代码
<ul>
<%=this.CheckBoxList(m=>m.Filter)
.Options(criteria.Choices, x => x.Code, x => x.DisplayText)
.Selected(Model.Filter)
.Label(criteria.Label).ItemFormat("<li> {0} </li>")
%>
</ul>
所以,我有一个基于“criteria.Choices”的复选框列表,其类型为 List
这是 ChoiceViewModel 的代码
public class ChoiceViewModel
{
// Some stuff
public string Code { get{ return _code; } }
public string Label { get { return _label; }}
public string DisplayText { get { return _displayText;}
}
}
我的问题是: 我想在某个条件下禁用复选框。
假设代码不以“A”开头,我想禁用复选框
我怎样才能做到这一点?
谢谢, 哈桑
【问题讨论】:
标签: mvccontrib fluenthtml