I have MVC 3 application and I want to know how to set the domain name to route to specific controller and action (without specify them), e.g. MyDomain.com to route to controller -> Landing, action -> landing.
The application is开发者_运维问答 hosted on IIS 6.
Regards, may.
You want to change the parameter defaults in the default route in global.asax:
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Landing", action = "Landing", id = UrlParameter.Optional } // Parameter defaults
);
精彩评论