public static string MultiSelectList(this HtmlHelper helper, MultiSelectList list, string name, bool disabled) { var output = new StringBuilder(); var i = 0; foreach (var item in list) { output.Append(helper.CheckBoxItem(name + "_" + i.ToString(), name, item.Selected, disabled, String.IsNullOrEmpty(item.Value) ? item.Text : item.Value, item.Text)); i++; } return output.ToString(); }
public static string CheckBoxItem(this HtmlHelper helper, string id, string name, bool isChecked, bool disabled, string value) { return helper.CheckBoxItem(id, name, isChecked, disabled, value, String.Empty); }