0
我剛剛開始發現FluentHml,並且我被CheckBoxList Helper卡住了。禁用MVcContrib.FluentHtml.CheckboxList中的複選框
下面是代碼
<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>
所以,我在此基礎上的類型爲列表<ChoiceViewModel> 「criteria.Choices」 一個CheckBoxList的。
下面是一個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」開始,我要禁用複選框
我怎樣才能做到這一點?
感謝, 哈桑