In my last blog post I walked through a simple example of how to
implement a /Products URL that renders a list of product categories:
![image_thumb_1263F129[1]](/ArticleFiles/2015/image001.gif)
Below is a simple ProductsController implementation that
implements the /Products URL above. It retrieves a list of product
categories from a database, and then passes them off to a view file to render
an appropriate HTML response back to the browser:
![image_thumb_579C4852[1]](/ArticleFiles/2015/image002.gif)
Here is what the Index.cshtml view file (implemented using
Razor) looks like:
![image_thumb_17A2B20D[1]](/ArticleFiles/2015/image003.gif)
The above view file does not yet use a layout page – which
means that as we add additional URLs and pages to the site we’ll end up
duplicating our core site layout in multiple places. Using a layout will
allow us to avoid this duplication and make it much easier to manage our site
design going forward. Let’s update our sample to use one now.