ASP.NET MVC User Routing A long user route without clicking on my head

Today I spent several hours reading user routing in ASP.NET MVC. I can figure out how to make any type of custom route if it expands or is similar / smaller than the default route. However, I am trying to figure out how to make a route similar to:

/Language/{LanguageID}/Question/{QuestionID}/

And what I would like is also similar to how SO works. Sort of:

/Language/{LanguageID}/Arabic/Question/{QuestionID}/Some-Question-Title

Where "Arabic" and "Some-Question-Title" can be almost anything, because the identifier really matters

A complete example URL could be

http://example.com/Language/22/Arabic/Question/135/What-is-the-importance-of-grammar

I do not agree with what can be done with the extended URL after the language identifier?

+3
1

, - , . MVC , , , , , , .

0

Source: https://habr.com/ru/post/1748687/


All Articles