Language

How Do I: Implement View Models to Manage Data for ASP.NET MVC Views?

By Chris Pels|21 minutes|

In this video Chris Pels shows how to use the concept of a "View Model" for managing data for ASP.NET MVC views. First, a sample MVC project is created that uses a ViewDataDictionary to package and pass data from a controller to a view. Next, a class is created which represents a view model for a view in the sample MVC project. As part of this implementation, the advantages of the view model approach are discussed. Finally, there is a discussion of how to partition the application logic when using a view model implementation.

DOWNLOADS: Code (C#)|Code (VB)|MP3|MP4|WMV

This article was originally created on December 11, 2009

Author Information

Chris Pels

Chris Pels – Chris has been instrumental in the architecture, development, and implementation of a wide variety of business systems and databases as a technology consultant since 1986. He has extensive experience in business analysis, technical specifications, database design, several programming languages including C# and VB.NET, and statistical analysis. He holds a Ph.D. from The University of Michigan and has been a speaker at Microsoft TechEd, Microsoft DevDays, VSLive, numerous events in New England