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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:14:42+00:00 2026-05-13T14:14:42+00:00

I am doing my first project in ASP.NET MVC and using the NerdDinner sample

  • 0

I am doing my first project in ASP.NET MVC and using the NerdDinner sample project in ScottGu’s book as a guide. In his project, all his strongly typed views neatly correspond to the objects he defined (e.g. Dinner). That is not really reality of a business application.

For instance, in my app, a page (e.g. View) gets most of its information from the primary object that the strongly typed View was created from. But it also has to display information from a dozen other objects.

So, what is the preferred pattern of passing all this information into the View?

  • Do I pass the primary object via the Model and the rest of the info via ViewData?
  • Do I create a master object for each View that encompasses all the data I might need for that page?
  • Is there a better approach?
  • 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-13T14:14:43+00:00Added an answer on May 13, 2026 at 2:14 pm

    You may define your strongly typed View with Data Transfer Object.

    Ex: Your View needs a Student list and a Teacher List, then you may define a data transfer object (wrapper):

    public class FrontPageDTO
    {
        public List<Student> StudentList { get; set; }
        public List<Teacher> TeacherList { get; set; }
    }
    

    Then pass an instance of this DTO to your View.

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

Sidebar

Related Questions

I'm doing my first ASP.NET MVC 3 project here, and since I need to
im doing my first asp.net MVC project here, i need to be able to
I'm doing my first project based on ASP.NET Membership and I'm having issues with
I'm doing project in asp.net mvc with Micorsoft Access database and I need to
I'm working on my first ASP.NET MVC application and have a strange issue. All
I have an ASP.NET MVC 3 project that I just created using the project
I'm doing a project in Asp .Net and C#. I'm also using ODP .NET
I am using JSON in Javascript for first time in my project of asp.net.
I have a c# asp.net MVC project. I am doing a a search and
I'm doing a project in asp.net using 3-tier architecture. Using various trial and errors

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.