The following content is reproduced from http://www.cnblogs.com/youshan/archive/2011/05/27/2060131.html
1 Note When you add a master page:
<asp:contentplaceholder id= "ContentPlaceHolder1" runat= "Server" >
</asp:ContentPlaceHolder>
This ID is I encountered and engaged in a long time, when adding view can not reference the master page, the original is the reason for the ID, to refer to which master page, id must match.
2, multi-level directory routing problem. In fact, this is not a routing problem, completely ignore it, in the Controller action in the return parameter set:
As follows:
Public ActionResult Index ()
{
Return View ("~/views/mvc/index.aspx")//returns the specified directory hierarchy, multiple directory nesting
}
3, after publishing the configuration of IIS
IIS 7.0
You can create website directly.
There may be a 500.19 error because you installed the VS before installing IIS
Solution: cmd Navigate to C:\Windows\System32\inetsrv
Run Appcmd unlock Config-section:system.webserver/handlers
If you do not have permissions, assign permissions to the directory Config folder.
IIS 6.0
If ASP.net MVC 1.0 is not installed on the server, the copy of SYSTEM.WEB.MVC, System.Web.Routing, System.Web.Abstractions three DLLs is required in the MVC app project The local property is set to true. These three DLLs need to be published with the project DLL.
There are two ways of deploying to IIS6.0
1, add extension
Change the routing method in the project Global.asax file (Add. mvc extension)
Routes. Maproute (
"Default",
' {controller}/{action}/{id} ',
New {action = "Index", id = ""}
);
Routes. Maproute (
"Root",
"",
New {controller = "Home", action = "Index", id = ""
};
Add. MVC mapping and Wildcard application Maps in IIS
IIS site--> Properties---> Home directory--> configuration--> mapping--> insert
Find C:\windows\microsoft.net\Framework\v2.0....\aspnet_isapi.dll, Cancel "Confirm file exists" (Do not select),--> OK
You can finally run under IIS
(-:-:)