Allow dashes within urls using asp.net MVC 4

UPDATE: This applies to MVC 5 too

I was kind of surprised recently when I wanted to create an asp.net MVC view with dashes in it and found out that I couldn’t.

To me, reading-a-url-like-this is better than readingaurllikethis so I thought there must be a way to get around this. After all, web apps like WordPress and Umbraco allow this so why can’t I just do it in asp.net MVC?

After doing a bit of research on the subject I found out that I needed to do a couple of things Continue reading