zoukankan      html  css  js  c++  java
  • MVC伪静态路由简单搭配

      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());
            }
  • 相关阅读:
    5.3公理系统
    5.2逻辑语言vs逻辑演算
    Spike-in 对照(Spike-in control)
    R 语言学习笔记(4)—— 数值&字符处理
    R 语言学习笔记(3)—— 基础绘图
    R语言学习笔记(2)——数据结构与数据集
    R 语言学习笔记(1)——R 工作空间与输入输出
    单核苷酸多态性SNP(single nucleotide polymorphism)
    你真的遵守编码规范了吗
    论牧羊犬如何混迹于Scrum圈
  • 原文地址:https://www.cnblogs.com/fanying/p/10918800.html
Copyright © 2011-2022 走看看