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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:57:49+00:00 2026-05-16T16:57:49+00:00

I ask myself how do I create a view model correctly. For instance, I

  • 0

I ask myself how do I create a view model correctly.

For instance, I have an edit view with some text boxes and a dropdownlist.

Should I separate the dropdown list into a new view model or shoud the edit view have one viewmodel with a list for the dropdownlist?

Or generally speaking, should I separate special input fields in separate view models?

When should a view have more than one view model and when not?

  • 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-16T16:57:49+00:00Added an answer on May 16, 2026 at 4:57 pm

    There’s no clear rule of how to create and organize your view models correctly. Your question is too vague to be answered because you provided too little context.

    I usually group view models according to functional blocks/parts of the screen they represent. So for example imagine that you have a complex form composed of multiple sections/fieldsets like contact details, delivery address, billing information, etc… An address could be composed of street, zip, city and country dropdown. I would create an address view model containing those four properties so that it can be reused in multiple views/partial views. This will also make validation easier as dependent properties will be packed into the same view model like validate for example that the given zip corresponds to the city and that the city belongs to the selected country.

    For instance, I have an edit view with
    some text boxes and a dropdownlist.

    Should I separate the dropdown list
    into a new view model or shoud the
    edit view have one viewmodel with a
    list for the dropdownlist?

    I would say no, if those fields are somehow functionally related.

    Conclusion: you will have to find the right balance between having a view model per field on the screen and having a single view model per application.

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

Sidebar

Related Questions

looking at dribbble, I have started to ask myself, how I would implement a
I always ask this to myself, and I think it's time to hear some
I ask myself how use multiple images in one. For example youtube -> http://s.ytimg.com/yt/img/master-vfl102488.png
I'm no Java guy, so I ask myself what this means: public Button(Light light)
I tried to ask this question before but I guess I didnt explain myself
I've found myself in a situation, that makes me ask for help. I've got
I'm just starting with distributed application development. I need to create (all by myself)
I am an iPhone developer. I create many mobile applications. Some of them need
I have to create a bunch of methods that look like this. The things
I'm planning to write a Windows app to help myself with some exploratory testing

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.