0
 <a href="/NewsDetail/@News.Title/Id">Foo</a>

When i click on this, it s being encoded and instead of space I m seeing %20 and so forth.

How can i create cleaner URLs ? just like what stackoverflow has?

Is there a utility for this?

I want something like this?

foobar.com/NewsDetail/some-specific-title/1
M4N
  • 92,565
  • 45
  • 215
  • 258
DarthVader
  • 49,515
  • 70
  • 199
  • 295
  • I guess you mean a slug. See here: http://stackoverflow.com/questions/tagged/slug+asp.net-mvc – M4N Dec 09 '12 at 23:33
  • 1
    possible duplicate of [How does StackOverflow generate its SEO-friendly URLs?](http://stackoverflow.com/questions/25259/how-does-stackoverflow-generate-its-seo-friendly-urls) – M4N Dec 09 '12 at 23:34

2 Answers2

2

This is how stackoverflow does it:

http://stackoverflow.com/questions/25259/how-does-stackoverflow-generate-its-seo-friendly-urls
Jack
  • 2,550
  • 22
  • 29
0

Read up on MVC routing for the default system.

And checkout this project AttributeRouting, install with nuget AttributeRouting, then you can put [GET("NewsDetail/some-malformed-title/1")] in front of your action and it just works.

Brad Christie
  • 98,427
  • 16
  • 148
  • 198
Darkmage
  • 1,577
  • 8
  • 22
  • 41