Note that there are some explanatory texts on larger screens.

plurals
  1. POPage won't change language
    primarykey
    data
    text
    <p>My page won't change the language could someone have a look at my code and tell me what im doing wrong it always goes to the default language</p> <pre><code>public partial class ChangeLanguage : BasePage { protected void Page_Load(object sender, EventArgs e) { SortedDictionary&lt;string, string&gt; objDic = new SortedDictionary&lt;string, string&gt;(); foreach (CultureInfo ObjectCultureInfo in CultureInfo.GetCultures(CultureTypes.SpecificCultures)) { RegionInfo objRegionInfo = new RegionInfo(ObjectCultureInfo.Name); if (!objDic.ContainsKey(objRegionInfo.EnglishName)) { objDic.Add(objRegionInfo.EnglishName, ObjectCultureInfo.Name); } } foreach (KeyValuePair&lt;string, string&gt; val in objDic) { ddlCountries.Items.Add(new ListItem(val.Key, val.Value)); } ddlCountries.SelectedValue = (HttpContext.Current.Profile as ProfileCommon).Preferences.Culture; } protected void btnChangeLanguage_Click(object sender, EventArgs e) { ProfileCommon profile = HttpContext.Current.Profile as ProfileCommon; profile.Preferences.Culture = ddlCountries.SelectedValue; } } protected override void InitializeCulture() { string culture = (HttpContext.Current.Profile as ProfileCommon).Preferences.Culture; this.Culture = culture; this.UICulture = culture; } Profile: &lt;properties&gt; &lt;add name="FirstName" type="String"/&gt; &lt;add name="LastName" type="String"/&gt; &lt;add name="Gender" type="String"/&gt; &lt;add name="BirthDate" type="DateTime"/&gt; &lt;add name="Occupation" type="String"/&gt; &lt;add name="WebSite" type="String"/&gt; &lt;group name="Preferences"&gt; &lt;add name="Culture" type="String" defaultValue="en-NZ" allowAnonymous="true"/&gt; &lt;/group&gt; &lt;/properties&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload