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

  • Home
  • SEARCH
  • 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 908639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:44:58+00:00 2026-05-15T16:44:58+00:00

Take the following controller action public ActionResult NextBySURNAME(int id, string data) { //code to

  • 0

Take the following controller action

    public ActionResult NextBySURNAME(int id, string data)
    {
        //code to process the data and edit the id accoringly not written yet
        return RedirectToAction("Edit", new { id = id });
    }

if I call it with
/Mycontroller/NextBySURNAME/12/Smith%20Simon

then it works fine (in this case editing record 12)
but

/Mycontroller/NextBySURNAME/12/Smith%20

gives me a 404

Now I know that in some cases in my problem domain trailing whitespace is significant, so I don’t just want to trim it. So why is this breaking my route ?

        routes.MapRoute(
            "Default", // Route name
            "{controller}/{action}/{id}/{data}", // URL with parameters
            new { controller = "Home", action = "Index", id = UrlParameter.Optional, data=UrlParameter.Optional } // Parameter defaults
        );
  • 1 1 Answer
  • 0 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-15T16:44:59+00:00Added an answer on May 15, 2026 at 4:44 pm

    So I did some route debugging and found that routes that end with a space weren’t even being evaluated by my MVC app. Therefore, IIS must be handling these requests poorly.

    I added a rewrite rule to IIS 7.5 to match trailing spaces and rewrite them as the same url without the space. I’m not satisfied with this solution but haven’t been able to find an explanation about why IIS mishandles URLs with trailing spaces.

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

Sidebar

Ask A Question

Stats

  • Questions 538k
  • Answers 538k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The first argument to parse() is the expected format. You… May 17, 2026 at 2:07 am
  • Editorial Team
    Editorial Team added an answer You have some options: Do something homegrown, parsing the text… May 17, 2026 at 2:07 am
  • Editorial Team
    Editorial Team added an answer Also be careful about the difference between a factor variable… May 17, 2026 at 2:07 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have the following Action Method that I'm trying to redirect from if the
Not sure how to frame this so here goes.... I have the following link_to
i have this model on mvc: public class User { public string Name {
I'm using ASP.NET MVC 2.0 and I am trying to take advantage of the
I am working on SportsStore example on chapter 4 from the following book and
In my application I have controller named Snippets both in default area (in application
I have the following two classes and I am starting to see a pattern
I find my edit actions in CakePHP controllers get messy pretty quickly, and I'd
The following problem has been fixed, I added an 's' to the end of
I've been running some experiments with ASP.NET MVC2 and have run into an interesting

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.