Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-07-16
2
Medium Priority
?
357 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 80 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
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…
Suggested Courses

927 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