How to use image resource in website


I have a c# site which makes use of a lot of images with embedded english text.

How can I use a standard resource file to swap out images depending on the language?

I have a resx file in my App_GlobalResources directory, but I can't seem to get it plugged into an asp:image control for the imageurl correctly.



For some further information, here is the image tag code:

<asp:image runat="server" ID="img2" ImageUrl="<%$Resources: Resource, cs_logo %>" />

The result on the client side is:

<img id="img2" src="System.Drawing.Bitmap" style="border-width:0px;" />

Note that the source is obviously not what I expected…

Best Solution

you can store the url of the image in your resource file and use the following inline code in the control

<asp:Image ImageUrl="<%$resources:Image1 %>" />


this link could be helpful on what you are trying to accomplish


you can also try to stored the resource as string and set the value to the url location instead of storing the image in the resouce file.