1
votes

I've got an interesting issue in my application.

My action method receives string parameter. And it works fine for all cases except the case when the last character in this string is a dot character. IIS shows HTTP 404 error due to can't to find the route for this case (I guess so).

My method receives the names of music bands. For example.

  1. http://mywebsite/artist/The-Strokes works fine
  2. http://mywebsite/artist/R.I.O. fails as I descripted above.

My route for this controller described as:

routes.MapRoute("", "artist/{artist}", new { controller = "Artists", action = "Name", artist = (string)null });

What the reason of this and how can I fix it?

Thanks a lot.

1

1 Answers

1
votes

You can think of use the {*catchall} in your route rules and then handle the param in your action

"artist/{*artist}"

or you can try to follow this article as an another (maybe better approach)