How to change language for an application from masterpage using ressource files in ASP.Net
<p>I have an appplication in ASP.Net with C#.
In the masterpage in aspx file I have 3 image buttons with 3 languages: english, french, romanian:</p>

<pre><code>&lt;asp:ImageButton ID="ImgRo" ImageUrl="~/Images/Romania Flag.png" runat="server" 
                 Height="25px" ToolTip="RO" style="border-color:black; 
                 background-color:black" OnClick="ImgRo_CLick"/&gt;|
&lt;asp:ImageButton ID="ImgEn" ImageUrl="~/Images/United States Flag.png" runat="server" 
                 Height="25px" ToolTip="EN" style="border-color:black; 
                 background-color:black" OnClick="ImgEn_CLick"/&gt;|
&lt;asp:ImageButton ID="ImgFr" ImageUrl="~/Images/France Flag.png" runat="server" 
                 Height="25px" ToolTip="FR" style="border-color:black; 
                 background-color:black" OnClick="ImgFr_CLick"/&gt;|
</code></pre>

<p>When I click one of each I have events to save chosen language on session :</p>

<pre><code>protected void ImgRo_CLick(object sender, EventArgs e)
{
    SaveLanguage("Ro");
}
protected void ImgEn_CLick(object sender, EventArgs e)
{
    SaveLanguage("En");
}
protected void ImgFr_CLick(object sender, EventArgs e)
{
    SaveLanguage("fr-Fr");
}

protected void SaveLanguage(string language)
{
    Session[AppDefs.LANGUAGE] = language;
    Thread.CurrentThread.CurrentCulture = new CultureInfo(language);
    Thread.CurrentThread.CurrentUICulture = new CultureInfo(language);
}

public string GetLanguage()
{

    if (Session[AppDefs.LANGUAGE] != null)
    {
        return Session[AppDefs.LANGUAGE].ToString();
    }
    else
    {
        return "en";
    }
}
</code></pre>

<p>In the master page I open login page and then other pages. How can I change UICulture for all pages when I choose from master page ?</p>

<p>I try in login page on preinit event this, but doesn't work:</p>

<pre><code>protected void Page_PreInit(object sender, EventArgs e)
{
   UICulture = Master.GetLanguage();//"fr-FR"
}
</code></pre>

<p>Thanks </p>
