惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
H
Help Net Security
Microsoft Security Blog
Microsoft Security Blog
The Cloudflare Blog
S
SegmentFault 最新的问题
小众软件
小众软件
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
量子位
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
V2EX
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
J
Java Code Geeks
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
Blog — PlanetScale
Blog — PlanetScale
Last Week in AI
Last Week in AI

博客园 - a-peng

My post test IE inline edit how to make hidden element actually hide EntityFramework4.1 Mapping Windbg IOC与AOP Custom Date and Time Format Strings group by Year(CreatedDate), Month(CreatedDate) 用sql, entity sql (linq表达式好像挺复杂) asp.net life cycle OH MY GOD! 我的后台页面都被IE可缓存了。。。 编译器错误消息: 类型“System.Data.Objects.DataClasses.EntityObject”在未被引用的程序集中定义。 让IFrame自适应高度 让IE8使用IE7兼容模式运行 - a-peng - 博客园 Visual Studio 2008 Html Designer无法加载 修改SQLServer2008数据表无法提交 jQuery plugin LazyForm定制您的CheckBox Radio和Select [转载] [翻译]在ASP.NET MVC中使用TDD与依赖注入 Asp.Net Mvc使用Ajax.BeginForm上传文件Request.Files始终为empty Asp.Net Mvc Ajax偏方 太疯狂了:Teleport Pro......It's incredible.
Asp.Net Mvc 3.0
a-peng · 2011-03-23 · via 博客园 - a-peng

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

    http://site.com/ > controller = Home, action = Index

    http://site.com/home/index > controller = Home, action = Index

    http://site.com/home/index/1 > controller = Home, action = Index, id = 1

http://site.com/test > controller = test, action = Index
    使用http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx进行验证

Route Tester

Type in a url in the address bar to see which defined routes match it. A {*catchall} route is added to the list of routes automatically in case none of your routes match.

To generate URLs using routing, supply route values via the query string. example: http://localhost:14230/?id=123

Matched Route: {controller}/{action}/{id}

Route Data
KeyValue
controller test 
action Index 
id
Data Tokens
KeyValue
All Routes
Matches Current RequestUrlDefaultsConstraintsDataTokens
False Admin/{controller}/{action}/{id} action = Index, id = (null) Namespaces = System.String[], area = Admin, UseNamespaceFallback = False
False {resource}.axd/{*pathInfo} (null) (null) (null)
True {controller}/{action}/{id} controller = Home, action = Index, id = (null) (null)
True {*catchall} (null) (null) (null)

Current Request Info

AppRelativeCurrentExecutionFilePath is the portion of the request that Routing acts on.

AppRelativeCurrentExecutionFilePath: ~/test

RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);