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

一、路由规则:
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>
 
 
上一篇:GridView按钮事件


下一篇:FruitFrolic