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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:13:03+00:00 2026-05-31T02:13:03+00:00

In asp.net mvc3, I currently have a single file ViewModels.cs which holds all of

  • 0

In asp.net mvc3, I currently have a single file ViewModels.cs which holds all of the viewmodel classes I use. The size of the file is only at 180 lines of code at the moment and is pretty easy to manage with #regions.

However, I fear these models could begin to add up. Moreover, it seems to me that if I break each view model class into its own file I will end up with a large amount of viewmodel.cs files.

I attempted to just make a generic view model but was advised against using generic classes as view models.

What is a better way to organize these view models, or a better approach in general to view models?

  • 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-31T02:13:05+00:00Added an answer on May 31, 2026 at 2:13 am

    My standard approach has been:

    • Project.Web
      • [Content]
      • [Controllers]
        • FooController.cs
      • [ViewModels]
        • FooViewModel.cs
        • BarViewModel.cs
      • [Scripts]
      • [Views]
        • [Foo]
        • [Shared]

    And , if necessary, you can add a reference to the namespace in your config file so you don’t end up adding ViewModels. to every reference:

    <pages>
      <namespaces>
        <add namespace="MyProject.Web.ViewModels" />
      </namespaces>
    </pages>
    

    If that’s of any help. I’ve also seen people break out the ViewModels / Models folder in to sub-directories based on controller, but I don’t usually go to that extent (though wouldn’t hurt).

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

Sidebar

Related Questions

i'm currently trying to make a asp.net mvc3 app. in the sample application which
ASP.Net MVC3 is cool and all but I have this question more out of
I am currently working on an ASP.NET MVC3 website. I have a simple authentication
I have a web application (ASP.NET MVC3) which uses the jquery ui tab control
Using ASP.Net MVC3 with C#. Currently I am trying to pass a single database
I am currently working on an ASP.NET MVC3 project in Visual Studio. I have
I'm currently toying with asp.net mvc3 and have a question with respect to models
I currently use the repository pattern in my ASP.NET MVC 3 app. I use
In ASP.NET MVC3 projects, is it faster, more secure, to use Entity Framework (with
With ASP .NET MVC3. In my controller I have this portion of code MasterMindDnetEntities

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.