© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
17 replies
Clink50

❔ Need help understanding Model Binding better

I'm trying to re-familiarize myself with .NET Core MVC after using Web Forms for about 6 years. I'm working on a CMS, and when you go to a page, you retrieve all the content for that page from the CMS, map it to a view model, and then display all that information on the page. The data could be a title and description for example. But what if I also need a form on that same page? Now my view model is title, description, and now it has the Name and Age for form values and when you click the submit button, it will redirect you to a page. If the name is not filled in, it will show the error message. This is very simple, and I understand that I could use Html.HiddenFor for the title and description but what if there is a lot of properties in the view model, say 20 properties. Do I have to have 20 hidden elements to pass the view model in the form submission when all I need is the name and age?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Need Help Understanding Casting
C#CC# / help
3y ago
MVC model binding issues
C#CC# / help
2y ago
i need help understanding this
C#CC# / help
2y ago
need help understanding `Task`s
C#CC# / help
3y ago