O'Reilly logo

Microsoft Visual Studio 2015 Unleashed, Third Edition by Mike Snell, Lars Powers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

View Components, View Models, and Partial Views

The customer example presented thus far shows working with a complete model class (Customer) and single views (Index, Create, Edit) that represent a full page. However, there are times when you need to reuse part of a view across different pages. For these occasions, ASP.NET allows you to create partial views and the new view components. Similarly, you may find yourself needing only a portion of a model class or a mix of a couple different objects and their properties. This is often the result of a specific view that does not map well to your individual model classes. In this case, you can create a view model. Let’s take a look at each of these modular components.

Partial View

A partial view is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required