您的位置:首页 > 其它

mvc2/3/4_伪静态_路由配置

2014-02-21 14:46 204 查看
一、路由规则:
routes.MapRoute(
name: "Default2",
url: "{controller}/{action}.html/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);


默认:routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

完成以上还不足够,还需要在webconfig配置:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: