Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 950257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:32:10+00:00 2026-05-15T23:32:10+00:00

So, I’ve run into a weird issue with a route in my application. For

  • 0

So, I’ve run into a weird issue with a route in my application. For some reason it just won’t match. It looks like {controller}/Comments/Put and it has corresponding constraints to make sure it gets into the right controller, in this case “Misc”. When I post to the route it just doesn’t match…

I plugged in the RouteDebugger library and it says “No Match!”, BUT, when I look at the table of routes, the one that’s crapping out has a green “True” under the “Match” column, so I’m at a slight loss. How can it match and not match at the same time?

I’ve gone as far as commenting out ALL other routes for the application and I still get the same result.

The one time it did work is when I changed the route to something stupidly long, but then I got another error that says I can’t Post to the action, which was because it was decorated with [HttpPut], BUT, I had the HttpMethodOverride as part of the post… Anyway, that’s another stupid bug that shouldn’t even be happening, but then again, that can be said for all bugs.

Idk if this makes any difference, it shouldn’t…, but the action that needs to be called is a RedirectToRouteResult action.

EDIT: I’ve also tried putting the route on the very top of the list so it get’s called first, still no change…

Anyway, if someone can point me to why the route is failing, I would really appreciate it!

Thanks in advance!

EDIT 2: To clarify a little bit more, the application is essentially for posting short messages and then commenting on those messages.

Posting a message works fine through an Ajax controller with a route of Ajax/Post/Put which matches {controller}/Post/Put. As you may notice the routes are very similar, but they are not conflicting with one another. Each route has a controller constraint in the form of controller = new ControllerConstraint("Ajax") or controller = new ControllerConstraint("Misc").

EDIT 3: To clarify a little bit more again, here’s the controller/action that should be called and the route in Global.asax:

MiscController : BaseController {
    [HttpPut, ValidateAntiForgeryToken]
    public RedirectToRouteResult PutComment(
        [Bind(Prefix = "Comment", Include = "Text")] Comment Comment) {
        // Do stuff...
    }
}

Routes.MapRoute("Misc (Put Comment)", "{controller}/Comments/Put", new {
    action = "PutComment"
}, new {
    controller = new ControllerConstraint("Misc")
});

EDIT 4: Hard-writing the route as follows has no effect:

Routes.MapRoute("Misc (Put Comment)", "Misc/Comments/Put", new {
    controller = "Misc",
    action = "PutComment"
});

EDIT 5: I’ve gone through and simplified all of the routes, no more params in the the url and no more constraints. So, the routes look like:

Routes.MapRoute("Misc (Comments)", "Misc/Comments", new {
    controller = "Misc",
    action = "Comments"
});

So, now that the route is completely hard-coded there should be no discrepancies about no matching routes. Plain and simple… or is it…

After trying that, it sort of worked, I was now getting yelled at that POST is not allowed, which was true because the action was decorated with PUT, BUT, the Http override was being sent across as it should have, but the framework completely ignored it(?).

So, moving on, I decided to retry the exact same post attempt, but this time enabling the route debugger gave me the following: The route was still not matching, YET in the routes table, it’s listed in green as matching. CONTRADICTIONS up the a**!!!

So, swallowing yet another BS error, I decided to disable every other route as well as every other method from all other controllers.

Guess what, I STILL GOT THE SAME RESULTS! It’s as if the framework goes completely SUPER MEGA HERP-A-DE-DERP on me…

I’m highly frustrated. I’ve written apps with far more complexity than this simple post/comment app and I’ve never ran into so much difficulties…

I just don’t know anymore…

::goes to a corner, curls up and starts crying::

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:32:11+00:00Added an answer on May 15, 2026 at 11:32 pm

    Ok, so I figured it out, I think, but either way it works now.

    My first mistake was in that I was suppressing an error coming from the database. The action had been called, but was crashing and suppressing the database error so from my point of view I was assuming that the action wasn’t being called because I never saw the data change.

    My second mistake that I wasn’t redirecting properly, or specifically I wasn’t specifying the controller for the redirect. In turn the redirect was trying to redirect to an action that didn’t exist within the same controller.

    I did however, and this is where it gets a tad contradictory, get an HttpVerb exception a couple of times. I can only assume that I was calling the original action and then redirecting to an existing action, but the redirect was retaining the HttpVerb thus causing the exception on the second action. This however still seems like a BS explanation which is probably wrong, but it’s the best way I can make sense of it.

    Lastly, I noticed that if a route is configured for controller A, but the action is actually in controller B, you will get an exception that makes it look like it was processing an “action” but failed. In other words, it will mislead you to think that you are hitting an action when you really aren’t.

    Anyway, hope this helps someone in the future.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.