zoukankan      html  css  js  c++  java
  • ASP.NET MVC Route Basic

    When the application first starts up (i.e., when Application_Start() runs), this code
    populates a global static RouteCollection object called RouteTable.Routes. That’s where the
    application’s routing configuration lives.

    MapRoute() adds an entry to the routing configuration.

    正常写法:

    routes.MapRoute(
    "Default"// Route name
    "{controller}/{action}/{id}"// URL with parameters
    new { controller = "Home", action = "Index", id = "" } // Parameter defaults
    );

    等价于:

    Route myRoute = new Route("{controller}/{action}/{id}"new MvcRouteHandler())
    {
    Defaults = new RouteValueDictionary( new {
    controller = "Home", action = "Index", id = ""
    })
    };
    routes.Add("Default", myRoute);
    技术改变世界
  • 相关阅读:
    2.15 STL复习
    20190214Test(栈与队列)
    STL列表链式前向星
    链式前向星(邻接表)
    Priority_queue详解
    List详解
    NOIP2019计划
    第二章笔记
    第一章笔记
    本地文件上传GitHub
  • 原文地址:https://www.cnblogs.com/davidgu/p/2398366.html
Copyright © 2011-2022 走看看