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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:08:09+00:00 2026-05-15T06:08:09+00:00

This one seems painfully obvious to me, but for some reason I can’t get

  • 0

This one seems painfully obvious to me, but for some reason I can’t get it working the way I want it to. Perhaps it isn’t possible the way I am doing it, but that seems unlikely. This question may be somewhat related: ASP.NET MVC Model Binding Related Entities on Same Page.

I have an EditorTemplate to edit an entity with multiple related entity references. When the editor is rendered the user is given a drop down list to select related entities from, with the drop down list returning an ID as its value.

<%=Html.DropDownListFor(m => m.Entity.ID, ...)%>

When the request is sent the form value is named as expected: “Entity.ID”, however my strongly typed Model defined as an action parameter doesn’t have Entity.ID populated with the value passed in the request.

public ActionResult AddEntity(EntityWithChildEntities entityWithChildEntities) { }

I tried fiddling around with the Bind() attribute and specified Bind(Include = "Entity.ID") on the entityWithChildEntities, but that doesn’t seem to work. I also tried Bind(Include = "Entity"), but that resulted in the ModelBinder attempting to bind a full “Entity” definition (not surprisingly).

Is there any way to get the default model binder to fill the child entity ID or will I need to add action parameters for each child entity’s ID and then manually copy the values into the model definition?

  • 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-15T06:08:09+00:00Added an answer on May 15, 2026 at 6:08 am

    Have you looked at AutoMapper? I agree that this shouldn’t be required because the binding should work but…

    I’ve had a little difficulty with using the Html.XYZFor helper and have reverted back to using the MVC 1.1 notation and it all works.

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

Sidebar

Related Questions

I can usually understand the reason behind a compiler warning, but this one seems
This one seems to be a simple problem, but I can't make it work
There are many questions like this but I can't find one that seems to
This one seems to be quite ridiculous but how can I open a VS
I can't figure this one out. It seems to work in IE8+ and Firefox,
Hey, so this is one of those questions that seems obvious, and I'm probably
This one seems like an easy one, but I'm having trouble calculating log (Base
http://jsfiddle.net/yTkTd/ Another function with a class works perfectly, but this one seems to be
I looked at a lot of tuts but this one seems to have got
Working on a responsive design and gradually losing hair and sleep. This one seems

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.