i have an image as such:
<img src="../pics/img.gif" runat="server" id="imgID" alt="Close" />
the image is not displayed unless i removed the runat="server".
is there any reason for this behavior?
It must be calling Control.ResolveClientUrl and ending up with the wrong path. If you look at the HTML source you'll probably figure out what's going wrong.
Try
<img src="~/pics/img.gif" runat="server" id="imgID" alt="Close" />
to set the path relative to the project root.
try
<asp:image ImageUrl="~/pics/img.gif" runat="server" ID="imgID" AlternateText="Close" />
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