Summary of IIS configuration issues after the release of asp.net mvc website

Source: Internet
Author: User

Recently I learned asp.net mvc. I used to learn it before and didn't use it at that time. Now I have spent a day or two to summarize the problems I encountered:

1 When adding a master page, note the following:

<Asp: ContentPlaceHolder ID = "ContentPlaceHolder1" runat = "server">
</Asp: ContentPlaceHolder>

This ID is something I have encountered and worked on for a long time. When adding a view, the master page cannot be used. It turns out to be the ID. When you want to reference a master page, the ID must match.

2. Routing Problems During Multi-Level directories. In fact, this is not a routing problem. You need to set it in the Response parameters of the action in the Controller:

As follows:

Public ActionResult Index ()
{
Return View ("~ /Views/MVC/Index. aspx "); // return the specified directory level, which can be nested with multiple directories.
}
3. Post-Release IIS configuration

In IIS 7.0
Simply create a WebSite.
 
The error 500.19 may occur because vs is installed first and iis is installed later.
Solution: navigate to C: \ Windows \ System32 \ inetsrv in cmd.
Run appcmd unlock config-section: system. webServer/handlers
If you do not have the permission, assign the permission to the config folder in the directory.
 
In IIS 6.0
If asp.net mvc 1.0 is not installed on the server. web. mvc, System. web. routing, System. web. set the copy local attribute of the three dll directories of Abstractions to true. These three dll files must be released together with the Project dll.
There are two methods to deploy to IIS6.0
1. Add Extension
Change the routing mode in the Global. asax file of the project (add the. mvc extension)
Routes. MapRoute (
"Default ",
"{Controller}/{action}/{id }",
New {action = "Index", id = ""}
);
Routes. MapRoute (
"Root ",
"",
New {controller = "Home", action = "Index", id = ""
};
Add. mvc ing and WildCard Application Maps in iis

Iis Site --> properties ---> main directory --> Configuration --> ing --> insert
Find c: \ windows \ microsoft.net \ Framework \ v2.0. .. \ aspnet_isapi.dll, cancel "check whether the file exists" (do not select), --> OK

Finally, it can be 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.