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 4557982
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:35:05+00:00 2026-05-21T17:35:05+00:00

I have 2 table in db: MixedType(id and name) and Block(id, name, idMixedType). I

  • 0

I have 2 table in db: MixedType(id and name) and Block(id, name, idMixedType).

I want to make strongly-typed view for Block (Create view).

Controller is following:

    public ActionResult Create()
    {
        return View();
    } 

Block() is a partial class (I use Entity Framework + POCO).

I have no problem with text fields, it works fine:

    <div class="editor-label">
        @Html.LabelFor(model => model.name)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.name)
        @Html.ValidationMessageFor(model => model.name)
    </div>

But I want to make dropdown for idMixedType field with values from MixedType table.

I tried to do it in following way (according to this answer Create a Dropdown List for MVC3 using Entity Framework (.edmx Model) & Razor Views && Insert A Database Record to Multiple Tables):

    <div class="editor-label">
        @Html.LabelFor(model => model.idMixedType)
    </div>
    <div class="editor-field">
        @Html.DropDownListFor(model => model.idMixedType, new SelectList(Model.MixedType, "id", "name"))
        @Html.ValidationMessageFor(model => model.idMixedType)
    </div>

But I have a error

The best overloaded method match for 'System.Web.Mvc.SelectList.SelectList(System.Collections.IEnumerable, string, string)' has some invalid arguments

What is wrong?

  • 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-21T17:35:06+00:00Added an answer on May 21, 2026 at 5:35 pm

    You’re passing in Model.MixedType to the SelectList constructor. Presumably Model.MixedType is not IEnumerable.

    Is it possible it should be a lowercase “m” (model.MixedType)?

    If not, you need to review the static MixedType property and make sure it is a collection that implements IEnumerable (and that the objects it enumerates have “id” and “name” properties, but I presume that’s the case).

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

Sidebar

Related Questions

i have table consist of columns : id,name,job and i have row stored with
I have table dates as following dates one two three four date1 id1 id2
I have table sort of like Name |DateOfEvent|EventType ---------------------------------- Smith |10/1/2005 |New Thomas |1/1/2002
I have table with ID who is PK and I have in same table
i have table , contain firstname and lastname , i used in my query
I have table columns with values in them and when you click the edit
I have table with 2 columns .... id id2 1 1 1 2 1
I'm having a bit of an issue uploading files to a database. The table
Having briefly studied databases in college, I haven't worked with them since and have
I started off with the notepad example on the android website. What I did

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.