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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:04:48+00:00 2026-06-17T14:04:48+00:00

I have a MVC4 C# project using Entity Framework and I want to know

  • 0

I have a MVC4 C# project using Entity Framework and I want to know how I can update multiple child entities from a parent entity.

I am using a view model to send the data from the two models to the view:

public class ResultData
    {
        public Result Result { get; set; }
        public IEnumerable<ResultNote> ResultNotes { get; set; }
    }

So I’m wanting to update all of Result’s notes on the Result Edit form.

My View:

@model RSC3_DB.ViewModels.ResultData
@foreach (var note in Model.ResultNotes)
  {
    <div class="editor-field">
        @Html.EditorFor(model => note.NoteText)
        @Html.ValidationMessageFor(model => note.NoteText)
    </div>
  }

This renders them on the form correctly. My question is what do I need to put in the Result controller “[HttpPost]ActionResult Edit” method to make the changes to the ResultNotes?

  • 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-17T14:04:49+00:00Added an answer on June 17, 2026 at 2:04 pm

    Turns out you just have to use a for loop with assigned an assigned index value and list each model attribute out.

    for (int i = 0; i < Model.ResultNotes.Count(); i++ )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a current MVC4.0 project I am using Entity Framework 4.1 Database first model.
I have trying to learn MVC4 Web API. I am running my project from
I have an MVC4 app which I've recently upgraded to Entity Framework 5 and
I have an MVC4 application with a Model (Entity) DLL project that is used
I have a ASP.NET MVC4 project with HTML5 semantic markup enabled. When using @Html.EditorFor(m
I have a problem that I suppose comes from my ASP.NET MVC project using
I'm using VS 2010 Premium. I have a MVC4 project using SqlCe 4.0 with
I have an ASP.NET MVC 4 project with Entity Framework 5, .NET 4.5 and
I've project using Entity Framework 5 Code First, WebApi, ASPNET MVC 4, Repository and
I'm currently using MVC4. I have a folder in my project that has files

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.