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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:01:17+00:00 2026-06-10T20:01:17+00:00

On an HTML form I have various controls bound to a Parent entity and

  • 0

On an HTML form I have various controls bound to a Parent entity and 2 Child entities (both one-to-one) required dependent.

When submitting the from [POST] the values persist fine for all controls bound to the Parent, and for all “text” type controls bound to the Child entities, but Child fields bound to dropdown controls are not persisting.

I’ve looked at the HTML source and found that the name and id tags are constructed differently for the controls, as a result the keys in the submitted form will be incorrect for all fields bound to a dropdown control.

Here are two example controls from the form with Parent table “Counterparty” and Child “CounterpartyFinancial”

Textarea control: value changes persist ok:
<textarea id="CounterpartyFinancial_WebAddress" name="CounterpartyFinancial.WebAddress">

Combo control: value changes don’t persist:
<select id="FinancialsSourceId" name="FinancialsSourceId">

The dropdown is constructed with

1) A SelectList in the Controller:

ViewBag.FinancialsSourceId = new SelectList(db.FinancialsSources, "FinancialsSourceId", "Name", counterparty.CounterpartyFinancial.FinancialsSourceId);

and

2) The DropDownList Helper in the view

@Html.DropDownList("FinancialsSourceId", String.Empty)

The control does reflect the correct value from the database.

Should I be using overrides in the dropdown helper, or is it more likely incorrect config/definition back up the line?

Thanks

  • 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-06-10T20:01:18+00:00Added an answer on June 10, 2026 at 8:01 pm

    I resolved this using the @Html.DropdownListFor helper

    @Html.DropDownListFor(x => x.SomePropertyOnModel, (IEnumerable<SelectListItem>)ViewBag.Clients);

    suggested by DavidAndroidDev here

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

Sidebar

Related Questions

I have am HTML form in a PHP page. The form has various inputs.
I have a simple HTML Form with one column having a select menu with
I have an HTML form on my website. The form has various fields and
I have a Web Content Form containing a Div and various Server controls like
I have a html form which have a select list box from which you
i have html form i am using <a href="#" onclick="document.aa.submit()"> instead of submit button
I have 11 checkboxes in my HTML form and already have a section in
I have a following problem, I have HTML form that uploads a file with
My input tag started to go crazy... I have html form for input to
hie i have a html form and while posting a request to a url

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.