After experiencing the webform framework, aspx introduced the MVC framework. I think the main purpose is to develop the framework and make it easy to test.
Some tutorials on installing the Internet have been written CodeTo record the problems encountered in the code.
First install the software environment you need
1. Visual Studio 2008
2. Dot NET Framework 3.5 extension (http://asp.net/downloads/3.5%2Dextensions)
The steps are as follows:
1. Create a project in vs2008, select the ASP. net mvc web application and test template, and enter the project file name productmvc
2. After the new project is created, the automatically generated file directory structure mainly includes models, views, and controllers.
There are home and share folders under views. Home has view files of corresponding actions, and share is a template file of Aspx.
3. Add the model file. Under the models folder, select Add-> data-> LINQ to data class.
Select the required database file and drag and drop the datatable of the database to the dbml design interface. Save the file and complete the definition of the LINQ data context.
4. Add-> MVC controller class under the controllers folder
5. Create a folder product under the views folder and add a new MVC View content page.
6. after completing the preceding steps, you can use http: // localhost/product/to access the index view of the product, but there is no required link on the site navigation, modify views-> share-> site. master File, add the product link to the template file to add a new controller to the navigation.