public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapRoute(
                "Root",
                "",
                new {controller = "Home", action = "Index", id = UrlParameter.Optional},
                namespaces: new string[] { "Jxrlzy.Controllers" }
                ); //根目录匹配
            
            routes.MapRoute(
                "Controller1Html", // action伪静态    
                "{controller}.html", // 带有参数的 URL    
                new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // 参数默认值
                namespaces: new string[] { "Jxrlzy.Controllers" }
                );
            routes.MapRoute(
                "Action1Html", // action伪静态    
                "{controller}/{action}.html", // 带有参数的 URL    
                new {controller = "Home", action = "Index", id = UrlParameter.Optional}, // 参数默认值
                namespaces: new string[] {"Jxrlzy.Controllers"}
                );
            routes.MapRoute(
                "Action", // action伪静态    
                "{controller}/{action}", // 带有参数的 URL    
                new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // 参数默认值
                namespaces: new string[] { "Jxrlzy.Controllers" }
                );
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}.html",
                defaults: new {controller = "Home", action = "Index", id = UrlParameter.Optional},
                namespaces: new string[] {"Jxrlzy.Controllers"}
                );
            ModelBinders.Binders.Add(typeof(JObject), new JObjectModelBinder());
        }

最新文章

  1. Xcode最好用的日志打印方法
  2. JavaScript高阶函数
  3. ActiveMQ第六弹:设置多个并行的消费者
  4. SequenceInputStream
  5. HTK搭建语音拨号系统实验材料下载
  6. Android 中ViewPagerIndicator的使用
  7. 刀哥多线程现操作gcd-10-delay
  8. elasticsearch中的mapping映射配置与查询典型案例
  9. css笔记11:选择器练习
  10. vim全局替换
  11. Jsoup 解析 HTML
  12. NYOJ 284 坦克大战 【BFS】+【优先队列】
  13. struts2原理分析
  14. 爬虫实战:爬虫之 web 自动化终极杀手 ( 上)
  15. [GitHub]第二讲:GitHub客户端
  16. 树莓派.系统.官方下载中NOOBS和Raspbian的区别
  17. PHP 中move_uploaded_file 上传中文文件名失败
  18. 更换Appsecrect应该要注意的问题
  19. Linux学习---指针运算、修饰符(const、volatile、typedef)及、运算符(++、--、+、-)
  20. grep正则表达式搜索

热门文章

  1. 【Android】【问题解决记录】Error obtaining UI hierarchy :Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!
  2. DVWA的搭建
  3. mysql 单表,多表,符合条件,子查询
  4. Python基础之输出格式和If判断
  5. 排序算法-桶排序(Java)
  6. 非vue等框架中html 中使用es6的模块用法小结
  7. celery工作原理介绍
  8. css 水平垂直居中两种常用方式
  9. Salesforce 开发整理(二)报表开发学习
  10. k8s 相关的命令