首页 > Web开发 > 详细

mvc5 添加 MapMvcAttributeRoutes 并且 html访问

时间:2020-10-26 19:54:59      阅读:54      评论:0      收藏:0      [点我收藏+]

在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" />

mvc5 添加 MapMvcAttributeRoutes 并且 html访问

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!