Quite simply, I would like to know how to set up a Master Page so that a background image in a table cell will always point to the correct Image path.
Currently I have a web site with a Master Page at the root and two folders, called Images and Games. Using a tilde ~ with the <asp:Image> image url path the page automatically makes sure the correct directory is pointed to in the source code.
In my source code the following image points to this path when a page in the root folder is loaded:
<img id="ctl00_Image1" src="/Images/logo.gif" style="border-width:0px;" />
and when loading a page in the Games folder it changes to this in the source code:
<img id="ctl00_Image1" src="../Images/logo.gif" style="border-width:0px;" />
..which is all fine - the correct image regardless of the current directory.
However, how on earth do you do the same for background images in a table cell?
For example in the root folder the following cell correctly displays the background image on the Master Page:
<td background="Images/background.gif" height="29">
but view a page in the Games directory and it just stays the same:
<td background="Images/background.gif" height="29">
..obviously meaning its now pointing to the wrong directory now, it hasn't updated automatically like the above image control.
Can someone tell me the correct way of dealing with this please? I've read you can't use the ~ for background images? So what's the solution?
Thanks in advance,
A (still) asp.net noob!