1

I am using the below route in MVC3 application

context.MapRoute("RoutName", "GetReport/{Id1}/{Id2}/{requestId}/{customerId}/
{CustomerVersion}/{Code}", new {controller= "ControllerName",action = "GetReport" });

This route works fine for below URL in the local environment

http://localhost/ControllerName/GetReport/104334/120531211240541002/120531211240551002
/120531211237331002/1/Code

But in the server i am getting "Access Blocked due to invalid characters in URL". Is there restriction on the length of the URL in MVC?

Any input would be great.

Nayan
  • 327
  • 6
  • 16
  • 1
    Does this question help you: http://stackoverflow.com/questions/1185739/asp-net-mvc-url-routing-maximum-path-url-length ? – Marthijn Feb 23 '12 at 10:05
  • I took a look the link and the URL length seems to be less than 150 characters. I am not sure what the issue in my case. – Nayan Feb 23 '12 at 12:19

1 Answers1

1

I have implemented your code in an empty MVC3 project but I'm not able to trigger your error, here the code just works fine.

ActionLink:

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

ActionResult:

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

What's different in your version?

Marthijn
  • 3,292
  • 2
  • 31
  • 48
  • Looks like the problem in the sever is due to some other component and now it seems to work correctly. Thanx for taking a dig at it. – Nayan Feb 24 '12 at 07:26