Microsoft created three DLL libraries for MVC this time, which are
System. Web. MVC. dll(The main MVC class integrates most of the original mvctoolkit methods );
System. Web. Export actions. dll(Httpcontextbase, httprequestbase, httpresponsebase, The original3.6In versionIhttpcontext, ihttprequest, ihttpresponseClasses evolved from interfaces)
System. Web. Routing. dll(The most common one here isRoutevaluedictionary)
Web. config
Compared with the previous version, the MVC preview 2 released this time removes the reference to system. Web. Extensions of version 3.6,
Therefore, all nodes that reference 3.6 must be changed to system. Web. Extensions of version 3.5;
The assemblies node references the three classes mentioned above.
The urlroutingmodule in httpmodules references
<Add
Name="Urlroutingmodule"
Type="System. Web. Routing. urlroutingmodule, system. Web. Routing, version = 3.5.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35"/>
Some modifications have been made to define route in global. ascx.
The original format is:
Routetable. routes. Add (NewRoute
{
Url ="[Controller]/[action]/[ID]",
Defaults =New{Action ="Index", Id = (String)Null},
Routehandler =Typeof(Mvcroutehandler)
});
Now changed:
Routetable. routes. Add (New
Route("{Controller}/{action}/{ID }",New
Mvcroutehandler())
{
Defaults =New
Routevaluedictionary(New{Action ="Index", Id = (String)Null}),
});
Here we will talk about a new function. The URL supports a * number. Example:{Controller}/{* afterstring}
For example, the client access URL isHttp: // localhsot/home/Scott/2007/8/2, then the afterstring value obtained in the controller is Scott/2007/8/2.
Controller
The attribute of the original [controlleraction] is canceled. I don't know why.
There are basically no other changes, that is, the original mvctoolkits cannot be used, resulting in greatCodeModify question.
MVC2 has just been installed. What new features have not been found. There are too few related online content. You are welcome to discuss it!