Creating user control/custom image control to handle multilingual site

S

SamIAm

Hi There

I need to create either a user control or custom control to replace my image
controls. I need to be able to dynamically assign a id and file name to the
control before rendering it.

Any help appreciated,

S
 
J

Jerry III

Why can't you just use server side img? Like this:

<script language="C#" runat="server">
public void Page_Load(Object sender, EventArgs e)
{
Img.src = "Whatever.png"; // Put your logic here to assign the source
url
}
</script>
<img id="Img" src="~/default.png" runat="server" />

The id should stay the same as the image should have the same meaning in
different languages, much like a header is always a header regardless if
it's in English or Japanese.

Jerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top