I have a tag in a master page. I use this master page in many folders. So the src path of the tag should be different for each folder. Here is my code :
<img src="images/1.gif" />
and I have a folder named "images" and a folder named "Users". Master Page is in the root, but I use it in Users folder.
How can I set a dynamic address for src?
The easiest way would be to use an asp:Image tag. You need to add runat="server" in order to use ~ syntax to resolve your URLs.
<asp:Image ID="myImage" runat="server" ImageUrl="~/images/1.gif" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With