Hello
I have a view where I'm going to list a checkbox-list (helper), and I'm not sure howto call that, since it always says my "type" is wrong.
I'm trying to call:
public static string CheckBoxList(this HtmlHelper htmlhelper, IEnumerable<string> values, IEnumerable<string> labels, string name)
{
return CheckBoxList(htmlhelper, values, labels, name, ((IDictionary<string, object>) null));
}
And view looks like:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AdminSite.Master" Inherits="System.Web.Mvc.ViewPage<BookingSystem.MVC.ViewModels.TestViewModel>" %>
Test
<h2>Test</h2>
<table>
<%= Html.CheckBoxList((IEnumerable<string>)Model.Usergroups, (IEnumerable<string>)Model.Usergroups, "asdf") %>
<% foreach (var item in Model.Usergroups) { %>
<tr>
<td>
<%= item.UsergroupName %>
</td>
</tr>
<% } %>
</table>
<p>
<%= Html.ActionLink("Create New", "Create") %>
</p>
How can I get this to work, I want my checkbox-list helper to work from different views, so I guess I have to convert the parameters somehow?
/M