ImageButton: Globalization with Themes RRS feed

  • Question

  • User1334482106 posted


    I've just inherited an ASP.NET (2.0) application that requires Globalization / Localization.  The application uses ImageButtons to display images that contain text...there's hundreds of them.  Actually, the application utilizes Themes too, so there is one copy of all the images per Theme (they differ by slightly different background colours etc).  An example of an image could be [ Add to Cart ] (which obviously can't be used for French users etc).

    After some advice of how best to tackle this....


    The ImageButton exists in the *.ASPX pages as follows:

    <asp:ImageButton ID="PreviewCartButton" runat="server" SkinID="previewCart"/>

    Note, the actual image to be displayed is NOT specified here, nor in the code-behind file....it's specified in the skin

    So, in the Theme's *.SKIN file, there are entries such as:

    <asp:ImageButton SkinID="previewCart" runat="server" ImageUrl="~/App_Themes/gray/buttons/preview_cart.gif" AlternateText="Preview your shopping cart" />

    However, I can't run any code in the skin file to swap the image to "preview_cart_en.gif" or "preview_cart_fr.gif" as executable code isn't allowed in SKIN files.

    Also, my gut feeling is that I don't want to have to administer multiple libraries of language-specific images.

    I have wondered about creating my own control where I create a table (or equiv) with three cells, each with a theme-specific background, and then I simply provide text to be displayed in the middle cell (left & right cells allow me the ability to have rounded "buttons" etc).

    Any suggestions here?

    Many thanks


    Wednesday, September 16, 2009 12:25 PM

All replies