Creating the View

The missing piece of our example application is the view. To create a view, right-click the Index action method and select Add View from the pop-up menu, as shown in Figure 23-5.

images

Figure 23-5. Creating a view for an action method

The Add View dialog will appear, as shown in Figure 23-6. This is our opportunity to configure the view.

images

Figure 23-6. The Add View dialog

Visual Studio sets the view name to Index, which will make this the default view for the Index action method. Ensure that the options in the dialog match the ...

Get Applied ASP.NET 4 in Context now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.