1. confirm that the host supports ASP. NET. At the beginning, I only saw support for ASP. net on the home page of the host service provider.ProgramPublished, and the result is displayed as "DOTNET disable". ASP. NET support is enabled on the Host Control Panel.
2. Modify the ASP. NET MVC2 web application created with vs2008
Modify the local copy attributes of the following references to true:
System. componentmodel. dataannotations
System. Core
System. Data. datasetextensions
System. Web. Category actions
System. Web. Extensions
System. Web. MVC
System. Web. Routing
System. xml. LINQ
Modify web. config, open it and check that there is too much content. I directly created an ASP under 2.0. net web application. the config file is copied in <system. add the following sentence to the Web> section:
<Httpmodules> <Add name = "urlroutingmodule" type = "system. web. routing. urlroutingmodule, system. web. routing, version = 3.5.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "/>
Because the VM cannot add mappings by itself, you also need to modify global. asax. CS |
Routes. maproute ("default", // route name "{controller}/{action }. aspx/{ID} ", // URL with parameters new {controller =" home ", Action =" Index ", id = urlparameter. optional} // parameter defaults );