从ASP.NET MVC路由生成URL
|
如果我有一些设置如下的路线:
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\" } );
如何生成使用路由路径而不是实际控制器/操作路径的URL?
例如。
Url.Action(\"Name\", \"Profile\")
应该生成\“ Public / DataCapture / Name \”,而不是\“ Public / Profile / Name \”
没有找到相关结果
已邀请:
1 个回复
眠皇