0

I want to 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.

Cœur
  • 37,241
  • 25
  • 195
  • 267
munish
  • 31
  • 1
  • 3

3 Answers3

1

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.

3Dave
  • 28,657
  • 18
  • 88
  • 151
0

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 ;)

Michael Shimmins
  • 19,961
  • 7
  • 57
  • 90
  • Michael I diployed the application on IIS6.0 and tryed to access by http://myip/Account and http://myip/Account/index then i got the 404 error. For this i installed mvc 2 framework on the server. So is there any settings regarding mvc on IIS 6.0 those are needed ? – munish Jan 12 '11 at 04:59
  • Do either http://stackoverflow.com/questions/2160838/hosting-mvc2-on-iis6 or http://stackoverflow.com/questions/2642403/asp-net-4-0-mvc2-routing-on-iis-6 help? – Michael Shimmins Jan 12 '11 at 05:03
0

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
);
Scott
  • 1,862
  • 1
  • 33
  • 53