Question

I want to have mvc action_name plus file extension in url like /Home/Index.aspx instead of /Home/Index; which route to Index action of Home Controller. Can anybody help me. Does anybody have any opinion or guideline?

Was it helpful?

Solution

routes.MapRoute(
                "RouteName",                                              // Route name
                "{controller}/{action}.aspx",                           // URL with parameters
                new { controller = "Home", action = "Index"}  // Parameter defaults
            );

Can you not do this

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top