MVC 伪静态

 

1.config

<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />

 

2.RouteConfig

routes.MapRoute(
"PRODUCT", // id伪静态
"{controller}/{_id}.html",// 带有参数的 URL
new { controller = "Product", action = "Detail", _id = UrlParameter.Optional }// 参数默认值
);
routes.MapRoute(
"Tie", // id伪静态
"{controller}/{_id}.html",// 带有参数的 URL
new { controller = "Tie", action = "Detail", _id = UrlParameter.Optional }// 参数默认值
);

posted @ 2016-08-08 10:20  11ge  阅读(267)  评论(0编辑  收藏  举报