Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul Sterling 716 posts 1512 karma points MVP 5x admin c-trib
    Oct 27, 2009 @ 20:08
    Paul Sterling
    0

    Localize a Drop Down List in User Control using Dictionary

    Any Umbraco wizards have a suggestion for localizing an <asp:DropDownList... control using the Umbraco Dictionary?

    I see this snippet is the pattern for file-based localization, but was looking for a more Umbraco'ish approach:

    protected override void OnPreRender(EventArgs e)
    {
        ResourceManager rm = ResourceManager.CreateFileBasedResourceManager("Country",
        Server.MapPath("~/Resources") + Path.DirectorySeparatorChar, null);

        ResourceSet rs = rm.GetResourceSet(CultureInfo.CurrentCulture, false, true);

        CountryList.DataSource = rs;
        CountryList.DataTextField = "Value";
        CountryList.DataValueField = "Key";
        CountryList.DataBind();
    }

    Thank you

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies