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
  • 94,805
  • 45
  • 217
  • 260
DarthVader
  • 52,984
  • 76
  • 209
  • 300
  • 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,600
  • 23
  • 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
  • 100,477
  • 16
  • 156
  • 200
Darkmage
  • 1,583
  • 9
  • 24
  • 42