mvc5 添加 MapMvcAttributeRoutes 并且 html访问

在RouteConfig加入

routes.MapMvcAttributeRoutes();

控制器中加入

[Route("list_{id}.html")]

下参考

[Route("list.html")]

[Route("list_{category}.html")]

html访问 在web.config加入

<add name="html_PageHandlerFactory" path="*.html" verb="*" type="System.Web.UI.PageHandlerFactory" resourceType="Unspecified" preCondition="integratedMode" />