Chapter 1. Getting started with the ASP.NET MVC Framework
Figure 1.1. A simple diagram depicting the relationship between the Model, View, and Controller. The solid lines indicate a direct association, and the dashed lines indicate an indirect association (graphic and description used with permission from Wikipedia).
Figure 1.2. The MVC Web Application project is a project template added to the C# and VB.NET sections of the New Project dialog. It’s only available when you have .NET Framework 3.5 selected as the target framework.
Figure 1.3. The default structure for a web application project using the ASP.NET MVC Framework uses conventions for the placement of files.
Figure 1.4. The starter project comes with a basic layout and CSS.
Figure 1.5. Classes that derive from ActionResult. This screenshot is from Red Gate’s .Net Reflector.
Figure 1.6. Our web application running in the browser. Note the simple URL and the absence of .aspx.
Figure 1.7. The web page has the same output as before. The end result is the same even though the controller implementation has evolved.
Figure 1.8. The proper location of the HelloWorld3 folder is inside the /Views folder. The default view factory uses this convention. You can override this behavior if you wish.
Figure 1.9. Adding the view to our project via the context menu
Figure 1.10. The output is the same as previous examples, except now we have a full HTML page and not an HTML fragment.