public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Workflow_FormContainer", "Workflow/form/{instanceNodeID}/{instanceFlowId}", new { controller = "FormContainer", action = "Index", instanceFlowId = UrlParameter.Optional} ); context.MapRoute( "Workflow_default", "Workflow/{controller}/{action}/{id}", new {action = "Index", id = UrlParameter.Optional } ); }
自定义了一个路由,似乎一定要加默认的路由之前,否则不生效.
http://localhost:20000/Workflow/form/1588
context.MapRoute( "Workflow_FormContainer", "Workflow/form/post/{instanceNodeID}/{instanceFlowId}", new { controller = "FormContainer", action = "Index", instanceFlowId = UrlParameter.Optional} );
不过把第一个路由改成 加一个 post ,放在默认的后面倒是可以