title: Programmatically change resource file language (resx) in Code Behind
body: <p>I have a .Net application in C# and I have a file structure something like:</p>
  
  <pre><code>App_LocalResources
   - MyPage.aspx.resx
   - MyPage.aspx.fr.resx
  MyPage.aspx
  MyPage.aspx.cs
  </code></pre>
  
  <p>I am trying to programatically change the language which tells the application which resx file to use. I want to do this in the code behind file (MyPage.aspx.cs).</p>
  
  <p>I have tried both of these in the OnPreRender, Page_Init, and Page_Load events:</p>
  
  <pre><code>Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-CA");
  Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-CA");
  </code></pre>
  
  <p>and it does not work. The page still shows the english language. The MyPage.aspx file has this:</p>
  
  <pre><code>&lt;h3&gt;&lt;asp:Literal runat="server" Text="&lt;%$ Resources:pageTitle %&gt;" /&gt;&lt;/h3&gt;
  </code></pre>
  
  <p>Note that I cannot care about the browser language. It must over-ride this. I have been searching the web for this solution to no avail. All examples show switching the language the way I have already tried (above) however this does not affect the resource file used. Any ideas?</p>