开发者

Deploy .net MVC 2 application on IIS6

开发者 https://www.devze.com 2023-02-03 14:05 出处:网络
I want to 开发者_JS百科deploy my .net MVC 2 application on IIS6.0. Will it require to change route path in global.asax file.

I want to 开发者_JS百科deploy my .net MVC 2 application on IIS6.0. Will it require to change route path in global.asax file.

In my application i have used html link, ajax request and Html.ActionLink.

The code lines in the Global.asax file are:

routes.MapRoute(
    "LogOn", 
    "{controller}/{action}/{id}", 
    new { controller = "Account", action = "Index", id = UrlParameter.Optional } 
); 

Please suggest me.


MVC2 works just fine in IIS6, though there are some gotchas with the 4.0 framework. Your routes won't be a problem, but you'll have to add a wildcard map for aspnet_isapi.dll to enable extensionless URLs.


Can't see a reason why it won't work. The routes don't need to be setup differently if you intend to deploy to IIS6.

The best way to find out is to try it ;)


I just put in an extension to tell iis to use the asp_net.dll. My urls aren't as pretty, but they work. i.e. they are like http://example.com/Home.aspx/ActionName/Id

routes.MapRoute(
    "root", // Route name
    "", // URL with parameters
    new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
    "Default", // Route name
    "{controller}.aspx/{action}/{id}", // URL with parameters
    new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
0

精彩评论

暂无评论...
验证码 换一张
取 消