locked
Localization RRS feed

  • Question

  • User-1934693923 posted

    Hi,


    I have doubt regarding localization. I need to show different images for image button based on different Culture.

    I have created resource file under app_globalresources for english and french. It is working for labels. based on selected culture, i can change text mark up. I need to load images for the image button from resx based on the culture. Any help appreciated.

    <asp:Label ID="lblWelcome" runat="server" 
                    Text="<%$ Resources:Resource, lblWelcome %>"></asp:Label> for label it is working


                    
                <asp:ImageButton ID="ImageButton1" ImageUrl="  "
                    runat="server" />


    How to add images from resouce file. Please help

    Thanks


    Thursday, March 18, 2010 7:32 AM

Answers

  • User1121294415 posted

    As far as i concern, the resource file is only for language text switching, i would recommend you using a database to store the images path based on resource file something like this

    <asp:ImageButton ID="ImageButton1" ImageUrl=" /generatemyimage?url=<%$ Resources:Resource, myimage %>"
                    runat="server" />

    Or if above idea does not work, you may create the button in dynamic mode, so it is created in page_load creation

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 18, 2010 8:08 AM

All replies

  • User1121294415 posted

    As far as i concern, the resource file is only for language text switching, i would recommend you using a database to store the images path based on resource file something like this

    <asp:ImageButton ID="ImageButton1" ImageUrl=" /generatemyimage?url=<%$ Resources:Resource, myimage %>"
                    runat="server" />

    Or if above idea does not work, you may create the button in dynamic mode, so it is created in page_load creation

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 18, 2010 8:08 AM
  • User-1200560727 posted

    Hi,

    Please go through my below post:

    http://forums.asp.net/t/1532087.aspx

    I hope it will helpful to you.


    Regards,

    Tapan

    Thursday, March 18, 2010 8:56 AM