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());
            }
  • 相关阅读:
    TUXEDO启动常见错误和解决方法 动常见错误和解决方法
    tuxedo远程客户端无法访问类故障(持续更新ing)
    ORA-00845: MEMORY_TARGET not supported on this system
    vim使用方法
    GP_CAT:209: ERROR: Write error 27, file /app/dir/dom/log/ULOG.011508
    txuedo TMS_ORACLE启动失败
    type类型定义
    oralce
    登录指定端口的ftp_server
    Failed to initialize NVML: Driver/library version mismatch
  • 原文地址:https://www.cnblogs.com/fanying/p/10918800.html
Copyright © 2011-2022 走看看