我试图在MVC中设置一个自定义路由,以从以下格式从另一个系统的URL:
../ABC/ABC01?Key=123\u0026amp;Group=456
01之后的第二个ABC是一个步骤号,这将改变,键和组参数将改变。我需要将其路由到控制器中的一个操作,步骤号键和组作为参数。我试过下面的代码,但它抛出一个异常:
码:
routes.MapRoute( "OpenCase","ABC/ABC{stepNo}?Key={key}&Group={group}",new {controller = "ABC1",action = "OpenCase"} );
例外:
`The route URL cannot start with a '/' or '~' character and it cannot contain a '?' character.`