Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1014741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:17:42+00:00 2026-05-16T10:17:42+00:00

I want to create a listBox: http://blog.wekeroad.com/blog/aspnet-mvc-preview-using-the-mvc-ui-helpers/ The Html.ListBox doesn’t work: <div class=editor-field> <%

  • 0

I want to create a listBox:
http://blog.wekeroad.com/blog/aspnet-mvc-preview-using-the-mvc-ui-helpers/

The Html.ListBox doesn’t work:

<div class="editor-field">
    <%
        string[] movies = new string [] { "a", "b", "c" };
    %>
    <%: Html.ListBox("lala", movies, new string[] { "b" })%>
</div>

I get the following errors:

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>'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:17:42+00:00Added an answer on May 16, 2026 at 10:17 am

    you want:

    Update: fixed a bug

    <%: Html.ListBox("lala", new SelectList(movies, "b"))%>
    

    where “b” is the default selected value

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this article [ http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package/ ], which explains how to use MVC Scaffolding
alt text http://www.freeimagehosting.net/uploads/abbcae9cd3.png I want to create a listbox like the one shown in
I made a custom listview following the tutorial in this link http://www.coderzheaven.com/2012/03/23/how-to-create-a-custom-listbox-in-windows-phone-7/ and My
I learnt example from msdn to populate a listbox control with arraylist. http://msdn.microsoft.com/en-us/library/1818w7we(v=VS.100).aspx I
I want to create content type with multiple ListBox's which populate dynamically depending on
I want to how to create a listbox with a vertical scrollbar in it..
I'm trying to create a transparent ListBox in a WPF application. I want the
I want to create a listbox that'll be bound to XPath, relative to the
Hi I want to create a looping listbox so that the last item's next
I want to create an app that has a listbox on the left side

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.