Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-07-16
2
Medium Priority
?
354 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

704 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