• MVC自定义路由的配置,必须把自己的路由写在前面


    MVC路由的选择是从上向下去找到,当找到满足条件的路由后会自动跳出.

    namespace OA { // Note: For instructions on enabling IIS6 or IIS7 classic mode, // visit http://go.microsoft.com/?LinkId=9394801 public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "dept", // Route name "dept/{id}", // URL with parameters new { controller = "department", action = "Index", id = "" } // Parameter defaults ); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); } protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); } } }

  • 相关阅读:
    Java 框架
    GridView1 footer求和
    常用CSS
    吉日分页转载
    强制刷新
    常用的CDN 链接 http://cdn.code.baidu.com/ http://www.bootcdn.cn/
    1、C#中Hashtable、Dictionary详解以及写入和读取对比
    webservice 交错数组
    vs plug
    DataReader方式 获取数据
  • 原文地址:https://www.cnblogs.com/lori/p/2051916.html
Copyright © 2020-2023  润新知