I am trying to add some parameters like rel and hreflang to my language selection links, but it seems that there is a limited number of parameters.
Is there any other solution to do that ? I know it's feasible with actionLink, but url.action seems to be easier for links on images...
<li><a href="@Url.Action(ViewContext.RouteData.Values["action"].ToString(), ViewContext.RouteData.Values["controller"].ToString(), new { culture = "en" }, null, new { rel = "alternate" }, new { hreflang = "en" })"><img class="language-flag" src="~/Content/images/flags/en.png" height="15" width="15" />@MyWebsite.Resources.Language.English</a></li>
Thannk you !
You should put them all inside the object parameter.
Url.Action(ActionString, ControllerString, Object)
@Url.Action(ViewContext.RouteData.Values["action"].ToString(),ViewContext.RouteData.Values["controller"].ToString(), new { @culture = "en", @rel = "alternate", hreflang = "en" })