Solved

How do I localize Images using a GlobalResource file (.resx) in asp.net?

Posted on 2009-07-16
2
341 Views
Last Modified: 2013-12-25
Hello, I have a banner in different languages for different versions of my website(english, french, etc) I have a .resx file for each language so it changes all the labels and textboxes to the selected language. However, I'd like to change the banner according to the selected language. Is there any way to do that?

0
Comment
Question by:CharLieYv
2 Comments
 
LVL 15

Assisted Solution

by:jinal
jinal earned 20 total points
ID: 24870628
Ues server side <asp:Image runat="server" ID='ControlImage' />

Generate resource file for each language you get ImageUrl property in that so set path over there. so it work that way.
0
 

Accepted Solution

by:
CharLieYv earned 0 total points
ID: 24871014
Well, thank you for your input Jinal. However, I find out a solution myself which is in code below... you only need to have an image folder and have each language image in each folder. I created a method that changes the image, depending on culture. Just call that method on PageLoad()


protected void Image_Chg()

    {

        string cul = Thread.CurrentThread.CurrentUICulture.Name;

        if (cul.Equals("en-US"))

           Image1.ImageUrl = "~/Images/en-US/CIDH_Banner_en.jpg";

        if (cul.Equals("es-ES"))

           Image1.ImageUrl = "~/Images/es-ES/CIDH_Banner.jpg";

        if (cul.Equals("pt-PT"))

           Image1.ImageUrl = "~/Images/pt-PT/CIDH_Banner_pt.jpg";

        if (cul.Equals("fr-FR"))

           Image1.ImageUrl = "~/Images/fr-FR/CIDH_Banner_fr.jpg";
 

    }

Open in new window

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Replacing HTML tags in Textarea/Textbox 5 26
c# code 19 59
getting id from database 5 24
COnsume rest client 6 11
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
The viewer will learn how to count occurrences of each item in an array.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now