Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 3 MVC路由器在URL中抛出无效字符_Asp.net Mvc 3 - Fatal编程技术网

Asp.net mvc 3 MVC路由器在URL中抛出无效字符

Asp.net mvc 3 MVC路由器在URL中抛出无效字符,asp.net-mvc-3,Asp.net Mvc 3,我在MVC3应用程序中使用以下路径 context.MapRoute("RoutName", "GetReport/{Id1}/{Id2}/{requestId}/{customerId}/ {CustomerVersion}/{Code}", new {controller= "ControllerName",action = "GetReport" }); 此路由在本地环境中适用于以下URL http://localhost/ControllerName/GetReport/104334/

我在MVC3应用程序中使用以下路径

context.MapRoute("RoutName", "GetReport/{Id1}/{Id2}/{requestId}/{customerId}/
{CustomerVersion}/{Code}", new {controller= "ControllerName",action = "GetReport" });
此路由在本地环境中适用于以下URL

http://localhost/ControllerName/GetReport/104334/120531211240541002/120531211240551002
/120531211237331002/1/Code
但在服务器中,我得到“由于URL中的无效字符而阻止访问”。MVC中URL的长度有限制吗


任何输入都会很好。

我已经在一个空的MVC3项目中实现了您的代码,但我无法触发您的错误,这里的代码运行良好

ActionLink:

@Html.ActionLink("Test", "GetReport", "Home", new { Id1 = 104334, Id2 = 120531211240541002, requestId = 120531211240551002, customerId = 120531211237331002, CustomerVersion = 1, Code = "Code" }, null)
行动结果:

public ActionResult GetReport(string Id1, string Id2, string requestId, string customerId, string CustomerVersion, string Code)
        {
            return new EmptyResult();
        }

您的版本有什么不同?

我已经在一个空的MVC3项目中实现了您的代码,但我无法触发您的错误,这里的代码工作正常

ActionLink:

@Html.ActionLink("Test", "GetReport", "Home", new { Id1 = 104334, Id2 = 120531211240541002, requestId = 120531211240551002, customerId = 120531211237331002, CustomerVersion = 1, Code = "Code" }, null)
行动结果:

public ActionResult GetReport(string Id1, string Id2, string requestId, string customerId, string CustomerVersion, string Code)
        {
            return new EmptyResult();
        }

您的版本有什么不同?

这个问题对您有帮助吗:?我查看了链接,URL长度似乎小于150个字符。我不确定我的问题是什么。这个问题对你有帮助吗:?我看了一下链接,URL长度似乎少于150个字符。我不确定我的问题是什么。服务器中的问题似乎是由其他组件引起的,现在它似乎工作正常。谢谢你挖苦了它。没问题,很高兴我能帮上忙。看起来服务器的问题是由其他组件造成的,现在它似乎工作正常。谢谢你挖苦我。没问题,很高兴我能帮忙。