title: ASP.NET MVC5 Change language/culture by clicking on Html.ActionLink
body: <p>I have a problem problem with my ASP.NET MVC5 appliaction. My app can set lang/culture which is set in the browser (only English and Polish (default) now). I want to let users change language/culture by clicking on Html.ActionLink. </p>
  
  <p>I created a class:</p>
  
  <pre><code>namespace Guestbook
  {
      public static class Click
      {
          public static void SetCulture(string name)
          {
              Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(name);
              Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
          }
  
      }
  }
  </code></pre>
  
  <p>And I have in my View:</p>
  
  <pre><code>@Html.ActionLink("PL", "", "Guests", routeValues: null, htmlAttributes: new { onclick = "SetCulture(\"pl\");" })
  @Html.ActionLink("EN", "", "Guests", routeValues: null, htmlAttributes: new { onclick = "SetCulture(\"en\");" })
  </code></pre>
  
  <p>Of course, it doesn't work. What do I need more? JavaScript function?</p>