MVC MapPageRoute and ActionLink

My guess is that you need to add some parameter options to the MapPageRoute declaration. So if you have more than one webforms page in the WebForms directory this works well.

routes.MapPageRoute  ("ReportTest",
                      "reports/{pagename}",
                      "~/WebForms/{pagename}.aspx");

PS: You may also want to have a look at the RouteExistingFiles property of RouteCollection

An alternative would be to use

<%=Html.RouteLink("Home","Default", new {controller = "Home", action = "Index"})%>

Leave a Comment