
Chapter 9: Creating Web Applications with ASP.NET MVC | 251 |
View
Request
Controller
Model
Figure 9-1 The Model View Controller pattern
View, and the Controller, including relationships. There are variations of the relationship between Model, View, and Controller, so rather than a theoretically correct depiction of all scenarios, Figure
In Figure
A typical sequence of operations for an ASP.NET MVC operation starts with a request to a Controller. The Controller will perform the actions requested, working with the Model. The Controller will then give the Model to a View and run the View. The View will display Model data and interact with the user for any screen operations. Based on user interaction with the View, more requests will be made to a Controller to repeat this process. The rest of this chapter shows you how to write the code to make this process work, starting with creating a new ASP.NET MVC project.
Starting an ASP.NET MVC Project
Just as with any other project in VS, you open the New Project window by selecting File New Project. Then create an ASP.NET MVC 2 Web Application project named MyShopCS (MyShopVB for VB). VS will ask if you want to create a test project, and