Summary of IIS configuration issues after asp.net MVC website release __.net

Source: Internet
Author: User

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

(-:-:)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.