我想创建一个列表框中: http://blog.wekeroad.com/blog/aspnet-mvc-preview-using-the-mvc-ui-helpers/C#ASP.NET MVC 2:HTML.ListBox不起作用
的Html.ListBox不起作用:
<div class="editor-field">
<%
string[] movies = new string [] { "a", "b", "c" };
%>
<%: Html.ListBox("lala", movies, new string[] { "b" })%>
</div>
我得到以下错误:
Error 1 'System.Web.Mvc.HtmlHelper<Transponder.Models.EditUserModel>' does not contain a definition for 'ListBox' and the best extension method overload 'System.Web.Mvc.Html.SelectExtensions.ListBox(System.Web.Mvc.HtmlHelper, string, System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem>, System.Collections.Generic.IDictionary<string,object>)' has some invalid arguments
Error 2 Argument 3: cannot convert from 'string[]' to 'System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem>'
Error 3 Argument 4: cannot convert from 'string[]' to 'System.Collections.Generic.IDictionary<string,object>'
感谢您的回复,它的工作:d – mweber 2010-08-26 09:44:32