I am struggling how to properly allow dashes / hypens in a URL in my MVC 4 / ASP.NET 4.5 app...for some reason MVC converts the dashes to underscores which is not what i want.
I've done a good bit of searching around before i posted the question, still can't find any easy solution. Everything i found seems way out of whack for such a simple configuration.
Basically, i would like to be able to access the following URL:
www.mysite.com/dashes-in-url
So for example, i created a controller named:
dashes-in-urlController.cs
The controller was named fine and allowed the dashes in the controller name.
However, when i created a view for the Index for the above controller, it created the view as:
Folder: /Views/dashes_in_url
With an Index.cshtml file in that folder - but it replaced my dashes with underscores.
So i have to access the url as:
www.mysite.com/dashes_in_url
with underscores instead of with the dashes in the URL.
Does anyone know of any elegant, simple solution to achieve what i'm trying to do?
Any help in this matter would be greatly appreciated, thanks!