This is how I think that this works
http://stackoverflow.com/questions/12333706/how-to-bla-bla-question
I think that there should be a controller action and link
@Html.ActionLink("how-to-bla-bla-question", "Questions", "Controller", new{questionId=12333706})
...
public ActionResult Questions(questionId)
{
...
}
Normally url should be
http://stackoverflow.com/questions/12333706/
Now is this handled by javascript or there is some other method how to make url with ID and title after it?
I have done exactly that like this.
Global.asax snippet:
And then something like this in the controller:
Note that this allows you to append a random slug which is exactly what stackoverflow does. However, stackoverflow then corrects your slug to the one stored in the database. This would be trivial to implement.
Also note that I have shown you my real code; you’d obviously need to tweak it a little bit (but not much) to fit your scenario. The important point is to append an optional url parameter in the route table. In my case I ignore it completely, which is actually what SO does too on the way in, hence you can navigate to this daft URL and still get here: https://stackoverflow.com/questions/12051094/i-like-to-eat-cake