I would like to know if there is some way to using Html.ActionLink
to set in which language has to be generated the URL of link using AttributeRouting
. I have tried with:
Html.ActionLink("DescriptionLinkText", "Controller", "Action",
new { language="en" }, null)
but it doesn't work. Is there a way to set to AttributeRouting
in which language has to be generated the URL.
What I need is to put at the top of my website links to change the current language. For example if the user is at /en/contact and click on links to change to spanish I want the same page was reloaded but in spanish language /es/contacto instead of redirecting to home page, for this reason I need to generate URL's in different culture of CurrentCulture to allow to change language and continue to the same page.
Thanks for your help