mvc5 添加 MapMvcAttributeRoutes 并且 html访问

时间:2020-10-26 19:54:59   收藏:0   阅读:54

在RouteConfig加入

routes.MapMvcAttributeRoutes();

控制器中加入

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

下参考

[Route("list.html")]

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

[Route("list_{category}_p{page:int}.html")]

 

html访问 在web.config加入

 

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

原文:https://www.cnblogs.com/future/p/13879124.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!