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

  • Home
  • SEARCH
  • 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 6327857
In Process

The Archive Base Latest Questions

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

I am wanting to create a view that allows me to add phone numbers

  • 0

I am wanting to create a view that allows me to add phone numbers for a person.

public class PersonModel
{
    public string Name { get; set; }
}

public class PhoneModel
{
    public string PhoneNumber { get; set; }
}

public class PersonDetailViewModel
{
    public PersonModel PersonDetails { get; set; }
    public IList<PhoneModel> PhoneNumbers { get; set; }
}

I am binding my main view to the viewmodel like

@model DynamicPhoneNumber.Models.PersonDetailViewModel
@{
ViewBag.Title = "Add";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
 @Html.ValidationSummary(true)
<fieldset>
    <legend>Details</legend>Name @Html.TextBoxFor(a => a.PersonDetails.Name)
    <input type="button" id="btnAdd" value="Press Me" />
    <div id="mydiv">
    </div>
    <p>
        <input type="submit" value="Create" />
    </p>
</fieldset>
}

My Partial view looks like

@model DynamicPhoneNumber.Models.PhoneModel
<p>
@Html.TextBoxFor(t => t.PhoneNumber)
</p>

Im using jquery to dynamically add the partial view.

On HttpPost I place a breakpoint and I can see the value from the PersonDetails.Name however none of the values from my loaded partialview are been bound to the PhoneModel.

What do I need to do to be able to return the data from the partial views into my viewmodel?

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

    here is a good blog post that may help to resolve your problem

    http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx

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

Sidebar

Related Questions

I am wanting to create a VB.Net app that checks a database and then
I am wanting to create a Model that has a property of Service which
I'm wanting to have my app (on launch) load a view that I have
public class YearMonthValueViewModel<TValue> { public List<MonthValueViewModel<TValue>> Months { get; set; } } public class
I have a feature which allows the user to create projects and view it
I want to create a component that allows us to have compound keyboard shortcuts
I'm wanting to create a read only text area in my app which allows
I'm wanting to create a stopwatch so to speak in order to score my
I'm wanting to create a WoW cooldown effect where a player does some action
I am wanting to create a drop shadow for an object (or anything for

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.