tags:

views:

66

answers:

1

I added a route to my asp.net mvc application to handle some json requests I need to do. This works great on my development pc, however when I installed in QA, the route isn't working at all. I tried to physically type in the address and get a "Bad Request". Can anyone assist with this? I have restarted IIS to try to clear any cache but still no luck. First time, I've seen this as I've made several changes to routes before.

routes.MapRoute(
            "FsrProblemTypesByEquipment",
            "Fsr/ProblemTypesByEquipment/{equipmentID}",
            new {controller = "Fsr", action = "ProblemTypesByEquipment", equipmentID = ""});
A: 

Do you still get a "bad request" if you take out the new route entry, but use the same test URL? If it is really a problem with your routing table, then your catchall route should get the request.

My guess is that the request is never getting to your routing table; IIS is catching the request before it gets passed to your application. If that is true, then it is a configuration problem in IIS, or IIS is unhappy with the construction of the URL for some reason.

See this forum post for more information:

http://forums.asp.net/p/1458130/3343674.aspx

Robert Harvey
yes, still get bad request. this is strange because i have several other routes like this and several other json requests that all work the same way
Mike Roosa
well, it looks like the problem is the equipment id had an * (asterisk) in it. once i changed that to a - it started working fine
Mike Roosa