Ric*_*ton 2 c# asp.net asp.net-mvc-routing asp.net-mvc-2
如果我有一些路线设置如下:
context.MapRoute("Route1", "Public/DataCapture/Name", new { controller = "Profile", action = "Name" } );
context.MapRoute("Route2", "Public/DataCapture/Age", new { controller = "Profile", action = "Age" } );
context.MapRoute("Route2", "Public/DataCapture/Amount", new { controller = "Income", action = "Amount" } );
Run Code Online (Sandbox Code Playgroud)
如何生成使用路径路径而不是实际控制器/操作路径的URL?
例如
Url.Action("Name", "Profile")
Run Code Online (Sandbox Code Playgroud)
应生成"Public/DataCapture/Name"而不是"Public/Profile/Name"
| 归档时间: |
|
| 查看次数: |
3978 次 |
| 最近记录: |