zoukankan      html  css  js  c++  java
  • MVC利用URLRoute实现伪静态

    routes.MapRoute(
                        "Default", // Route name
                        "{controller}/{action}.html", // URL with parameters
                        new { controller = "Portal", action = "Index", id = UrlParameter.Optional }
                        ); //首页伪静态
                routes.MapRoute(
                        "ArticleList", // Route name
                        "{controller}/{action}/{typeId}.html", // URL with parameters
                        new { controller = "Article", action = "List", typeId = UrlParameter.Optional }
                        ); // 文章类型列表伪静态
                routes.MapRoute(
                        "ArticleDetail", // Route name
                        "{controller}/{action}/{id}.html", // URL with parameters
                        new { controller = "Article", action = "Detail",id = UrlParameter.Optional }
                        ); // 文章详情页伪静态
                routes.MapRoute(
                        "JobList", // Route name
                        "{controller}/{action}/{id}.html", // URL with parameters
                        new { controller = "Job", action = "Detail", id = UrlParameter.Optional }
                        ); // TODO
                routes.MapRoute(
                        "JobDetail", // Route name
                        "{controller}/{action}/{id}.html", // URL with parameters
                        new { controller = "Article", action = "Detail", id = UrlParameter.Optional }
                        ); // TODO

  • 相关阅读:
    MySQL隐式类型转换导致索引失效
    解决MySQL报错[Err] 1093
    二:C#对象、集合、DataTable与Json内容互转示例;
    一:Newtonsoft.Json 支持序列化与反序列化的.net 对象类型;
    Newtonsoft.Json 概述
    为什么Elasticsearch查询变得这么慢了?
    Elasticsearch 5.x 字段折叠的使用
    Elasticsearch 删除数据
    Linux环境下安装 ElasticHD
    ElasticHD Windows环境下安装
  • 原文地址:https://www.cnblogs.com/8090sns/p/rewrite.html
Copyright © 2011-2022 走看看