ASP.NET MVC, localized routes and the default language for the user

Viewed 19530

I am using ASP.NET MVC localized routes. So when a user goes to the English site it is example.com/en/Controller/Action and the Swedish site is example.com/sv/Controller/Action.

How do I make sure that when a user enters the site he/she comes to the correct language directly? I do know how to get the language I want, that is not the issue. The thing I used to do is that I put that culture into the RegisterRoutes method. But because my page is in integrated mode I cannot get the request from Application_Start.

So how should I make sure that the route is correct right from the beginning?

4 Answers
Related