title: MVC - changing part of URL in a link
body: <p>I have a site that supports localization. I would like to be able to switch between English and French.</p>
  <p>Let say the user is currently at URL:
  <a href="http://www.example.com/**en**/Home" rel="nofollow noreferrer">http://www.example.com/**en**/Home</a></p>
  <p>I would like to redirect to:
  <a href="http://www.example.com/**fr**/Home" rel="nofollow noreferrer">http://www.example.com/**fr**/Home</a></p>
  <p>If the user click on a &quot;French&quot; link how to change the URL part to &quot;fr&quot; yet not change the &quot;Home&quot; part of the URL (basically I want preserve the current location of the user)</p>
  <p>Hope my question makes sense! I'm probably missing something very basic?</p>
  <p>EDIT: Kind of found a solution.</p>
  <pre><code>&lt;%= Html.ActionLink(&quot;Français&quot;, ViewContext.RouteData.Values[&quot;action&quot;].ToString(), ViewContext.RouteData.Values[&quot;controller&quot;].ToString(), new { culture = &quot;fr&quot; }, null)%&gt;
  &lt;%= Html.ActionLink(&quot;English&quot;, ViewContext.RouteData.Values[&quot;action&quot;].ToString(), ViewContext.RouteData.Values[&quot;controller&quot;].ToString(), new { culture = &quot;en&quot; }, null)%&gt;
  </code></pre>
  <p>This maintains the action/controller of the current URL. Maybe there's a cleaner solution?</p>