An empirical summary of using asp.net mvc in IIS __.net

Source: Internet
Author: User

In this article we learned to use asp.net mvc and URL Routing in different versions of IIS. We learned about handling policies for IIS7.0, IIS6.0, and earlier versions of IIS.

The ASP.net MVC framework relies on URL Routing, and to take full advantage of URL Routing, we need to make some extra configuration of the Web server (IIS).

The latest version of IIS is IIS7.0 in Windows2008, and we can also install IIS7.0 in Vista (except Home Basic edition).

IIS7.0 is a model that provides two types of processing requests-integration patterns and traditional patterns. If you use IIS7.0, then we do not need to do any configuration, if we want to use the traditional mode, we need to do some additional configuration work.

IIS6.0 is installed in Windows2003, and if it is Windows Server 2003, then we can upgrade IIS6.0 to IIS7.0. But if we use IIS 6.0, then we need to do some extra configuration work.

The IIS5.1 version of the Windows XP Professional installation, so we also need to do some extra configuration work for IIS5.1.

Finally Windows2000 is using IIS5.0, and we also need to do some extra configuration work for IIS5.0.

Here's a summary of our different versions of IIS:

IIS7.0 (Integrated mode)-you can use URL Routing without any configuration required.

IIS7.0 (Traditional mode)-we need to make a special configuration to use the URL Routing.

IIS6.0 or lower version-we need to make a special configuration to use the URL Routing.

integration mode and traditional mode

IIS7.0 can use both modes to handle request-integration and traditional patterns. Integration mode provides better and more functionality; traditional mode is for backward compatibility with older versions of IIS.

The processing mode of the request is determined by the program pool, and we can set the request processing mode of the Web application by specifying how the program pool is associated with the application. The steps are as follows:

1. Run IIS Service Manager

2. Select an application in the Connections window

3. Click the basic settings connection in the Actions window to open the Edit Application dialog box, as shown in the following illustration.

4. Set application pool.

By default, IIS is configured to support two types of application pools: DefaultAppPool and Classic. NET AppPool. If set to DefaultAppPool, then our application will run in Integrated request processing mode. If you set Classic. NET AppPool, our application runs in the traditional request processing mode.

Note that we modify the request processing mode by clicking the "Select" button in the Edit Application dialog box to change the association between the program pool and the application. But ASP.net applications need to address several compatibility issues when migrating from traditional mode to Integrated mode. For more information, see the following articles:

Upgrading ASP.net 1.1 to IIS 7.0 on Windows Vista and Windows Server 2008--HTTP://LEARN.IIS.NET/PAGE.ASPX/270/UPGRADING-A spnet-11-to-iis7-on-windows-vista--windows-server-2008/

asp.net integration with IIS 7.0-http://learn.iis.net/page.aspx/243/aspnet-integration-with-iis7/

If our asp.net application uses DefaultAppPool, we can use the URL routing function without any configuration. But if the ASP.net program is configured to classic. NET AppPool, keep looking down.

second, using ASP.net MVC in older versions of IIS

If we use an IIS version that is lower than IIS7.0 or uses the IIS7.0 traditional mode, then we have two options:

1, modify the routing table, plus the file name extension. If we change the URL address of/store/details to/store.aspx/details

2, create wildcard script map. The wildcard script map allows us to map each request to the ASP.net framework.

If I can't modify the server configuration, we have to take the first approach and if we don't want to modify the URL, we have to configure the IIS Web server in the second way.

Here we discuss two ways to use ASP.net mvc in older versions of IIS:

(i) Add an extension to the routing table.

The easiest way to make URL routing run on older versions of IIS is to open the Global.asax file and modify our routing table. The code for the routing table is as follows:

Listing 1–global.asax (unmodified)

using system;    using system.collections.generic;    using system.linq;    using system.web;    using system.web.mvc;    using system.web.routing;     namespace mvcappcs    {             public class globalapplication : system.web.httpapplication             {                   public static void registerroutes (routecollection routes)                    {                          Routes. Ignoreroute ("{resource}.axd/{*pathinfo}");                         routes. Maproute (                               "Default",// route name                                "{controller}/{action}/{id}",// url with  parameters                      
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.