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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:30:04+00:00 2026-05-26T01:30:04+00:00

I have uploaded my code to pastebin, this is the link: http://pastebin.com/wBu9PP2x When i

  • 0

I have uploaded my code to pastebin, this is the link:

http://pastebin.com/wBu9PP2x

When i submit a form, the Lists that i use are not bound to my ViewModel.

But when i send the ViewModel to the view, it renders fine using EditorFor. I have read that when using EditorTemplates, it is supposed to name the List appropriately so that they are bound to the ViewModel automatically upon postback.

The HTML output can be seen here:

http://pastebin.com/5KeyNXWC

Notice that the ViewModel derives from ShowQuestionViewModel, which contains some strings. These strings get bound perfectly.

This is the tutorial i have been following:

http://jarrettmeyer.com/post/2995732471/nested-collection-models-in-asp-net-mvc-3

In the tutorial, the MVC framework knows how to bind lists inside of a ViewModel.

Here are some debugger outputs:

Controller takes ShowQuestionViewModel as parameter:

http://imageshack.us/photo/my-images/803/debug.jpg

Controller takes FormCollection as parameter:

http://imageshack.us/photo/my-images/542/formcollection.png

Different Controller that takes a List and FormCollection as parameter:

http://imageshack.us/photo/my-images/685/listtest.png

Dont give up on me guys!!

Thanks!

Solution

I have found this solutin myself. I forgot to use Properties for the rows and columns list in the ShowMatrixQuestionViewModel. Also, the ActionController wont bind without TryUpdateModel() so thanks to @Adam Tuliper as well as the rest.

  • 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-26T01:30:12+00:00Added an answer on May 26, 2026 at 1:30 am

    Since you mentioned lists are you sure your model Upon postback contains all of the expected items? Also remembe the HTML helpers will use modelstate to bind data from as well if you are showing data after a post and not redirecting.

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

Sidebar

Related Questions

I'm currently using the following code to scan files that have been uploaded as
I have uploaded the following simple HTML code to http://losthobbit.net/temp/anchor.html <!DOCTYPE HTML PUBLIC -//W3C//DTD
I have my asp .net website. I have uploaded that. But is shows code
I have this JavaScript code: $(#midden-offertes form .subvragen).hide(); $(#midden-offertes form .veld .radio :radio).change(function() {
I am trying to resize an image that I have uploaded with a form.
Once you have uploaded your source code to Heroku, is it possible to download
I have uploaded a page with the code below to my joomla root directory.
I have a website that I've just uploaded onto the Internet. When I browse
Currently I have an application that receives an uploaded file from my web application.
I have a unit test that works fine locally but when uploaded to TeamCity

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.