Overview
December 10 Microsoft released a preview of the ASP.net 3.5 extension, which includes the ASP.net MVC Framework, asp.net ajax improvements, and ASP. NET Dynamic Data support, ASP.net Silverlight support, and ado.net data Services. I also downloaded the first time to install and experience the Microsoft ASP.net MVC Framework.
Mention MVC, I believe that everyone is not unfamiliar, here simple to mention two sentences, the implementation of an application is divided into three parts: models (model), view, controller (Controller). The model is used to maintain state, the view is only responsible for the display of information, controller users to process and respond to user input and interaction. This article is a simple example to experience the ASP.net MVC Framework.
Installation
1. Need to install VS2008 RTM or Visual Web Developer 2008 Express.
2. Download and install ASP.net 3.5 Extensions. Download Address: http://asp.net/downloads/3.5-extensions
Creating an MVC Application
After the installation is complete, you will see the ASP.net 3.5 Extensions Web sites in the new Web site (I am using the visual Web Developer 2008 Express):
Once established, the structure of the site is not different from the normal web site (what is not known under VS 2008 RTM), except that some configuration has been added to the web.config, such as adding urlroutingmodule:
<add name= "UrlRoutingModule" type= "System.Web.Mvc.UrlRoutingModule,
System.Web.Extensions, version=3.6.0.0, culture=neutral, publickeytoken=31bf3856ad364e35 "/>
Building data Model objects (models)
Under the App_Code folder, create a Models folder and add a LINQ to SQL Classes:
Name product is ProductInfo.