Below is a screen-shot of the simple application we have
been building:
Here is the ProductsControllers that implements the
/Products URL and retrieves the categories from a database and passes them to a
view template to render:
Here is the Index.cshtml view that we are using the render
the /Products response:
Here is the SiteLayout.cshtml layout file we are using to
implement a consistent look and feel across our site:
Here is the _ViewStart.cshtml file that we are using to
specify that all views in our site by default use the SiteLayout.cshtml file:
And here is the generated HTML from the /Products URL:
And because we now have a common layout file for our site,
we can build out more functionality, controllers and views within our
application - and have a site UI experience that is both consistent and very
easy to maintain.