broken image problem

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hi

asp.net 3.5

In a Web User Control I have this image tag:
<img src="Images/normal.gif" name="link2" border="0" />

This image tag works great when the Web User Control is used on pages on the
root folder, like Default.aspx..
But when .aspx is at a subfolder (like ~/Pages/) then it displays broken
image icon for this image...

(the Web User Controls are in the Control folder, ~/Controls/)

what should I do to fix this problem?
 
Try:

<img src="~/Images/normal.gif" name="link2" border="0" runat="server" />

Since it's now a server control, the ~/ will evaluate to your root directory
no matter what directory yer in.
 
Back
Top