Database Reference
In-Depth Information
In the Add View dialog box shown in Figure 4-10 , select View Engine as Razor (CSHTML), and then click the
checkbox to create a strongly-typed view, and finally select the Model class as Category (MyStore.Models).
Figure 4-10. Adding a view
The index view in Listing 4-3 displays a page that lists the app categories, along with buttons for inserting new
categories as well as editing and deleting current categories. The create view page in Listing 4-4 is used to insert a new
application category.
Listing 4-3. The Code of Index View
@model IEnumerable<MyStore.Models.Category>
@{
Layout = null;
}
<!DOCTYPE html>
 
Search WWH ::




Custom Search