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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:04:18+00:00 2026-05-14T20:04:18+00:00

I’m trying to get a nested model to bind correctly with a nested view

  • 0

I’m trying to get a nested model to bind correctly with a nested view but am not having any luck.

Here is a detailed look

This is the class

public class Foo
{ 
    public AnotherClass AnotherClass { get; set; }
    public string Name { get; set; }
    public ......
}

Inside AnotherClass we have more sub objects such as

public class AnotherClass 
{
    public AThirdClass { get; set; }
}

The third class has the properties that we want to bind to.

public class AThirdClass
{
    public string ImportantString { get; set; }
    public string SecondString { get; set; }
}

The primary view is expecting a class of type Foo. Inside of that View we call the html helper to render the partial view which expects a model of type AnotherClass which we pass in. The call would be

<% Html.RenderPartial("MyPartialView", Model.AnotherClass); %>

Inside the partial view MyPartialView we have text boxes for editing fields in AThirdClass and they are set up like this

<%= Html.TextBox("AThirdClass.ImportantString", Model.AThirdClass.ImportantString) %>

When we post back to the server I’m loosing all the data that was entered in the text box. Is this not supported in MVC 1.0? I am able to use this technique if I don’t have any partial views while still using nested objects?

It looks like in MVC 2.0 you can use the EditorFor HTML helper to do what I need to do however I’m stuck on MVC 1.0.

What am I doing 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-14T20:04:19+00:00Added an answer on May 14, 2026 at 8:04 pm

    I’ve got a work around for this.

    If you pass the full view model into the partial and then reference the sub objects right from the top model then you will be fine.

    I would still like to hear how anyone else has done this though.

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

Sidebar

Ask A Question

Stats

  • Questions 416k
  • Answers 416k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Using .htaccess adds overhead since Apache has another item it… May 15, 2026 at 9:24 am
  • Editorial Team
    Editorial Team added an answer It's usually more efficient to do everything in SQL but… May 15, 2026 at 9:24 am
  • Editorial Team
    Editorial Team added an answer The wildcard character is .. To match any number of… May 15, 2026 at 9:24 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.