S
Steve Franks
I am familiar with the fact that you have to use runat=server and links
staring with "~/" to ensure proper mapping of paths to relative URLs when
using master pages. However this does not seem to work in all cases.
For instance, assume I have a "/mysite/images" subdirectory with
mybackground.gif and mygif.gif in there.
Further assume I have a master page called mastertest.aspx located in
/mysite/myfolder".
In mastertest.aspx this works to produce a proper link to an image:
<img src="~/images/mygif.gif" width="10" height="18" runat=server>
However, this DOES NOT work:
<table width="100" background="~/images/mybackground.gif" runat=server>
For some reason the runat=server works to translate links properly when its
an IMG SRC tag, but not when its a BACKGROUND attribute in a table tag. Why
is this?
What is the work around for this situation? I need to be able to have
ASP.NET dynamically generate the proper relative links to my background
images that are used by my html tables via the BACKGROUND attribute.
Please let me know what I am doing wrong and how I can fix this.
Thanks!
Steve
staring with "~/" to ensure proper mapping of paths to relative URLs when
using master pages. However this does not seem to work in all cases.
For instance, assume I have a "/mysite/images" subdirectory with
mybackground.gif and mygif.gif in there.
Further assume I have a master page called mastertest.aspx located in
/mysite/myfolder".
In mastertest.aspx this works to produce a proper link to an image:
<img src="~/images/mygif.gif" width="10" height="18" runat=server>
However, this DOES NOT work:
<table width="100" background="~/images/mybackground.gif" runat=server>
For some reason the runat=server works to translate links properly when its
an IMG SRC tag, but not when its a BACKGROUND attribute in a table tag. Why
is this?
What is the work around for this situation? I need to be able to have
ASP.NET dynamically generate the proper relative links to my background
images that are used by my html tables via the BACKGROUND attribute.
Please let me know what I am doing wrong and how I can fix this.
Thanks!
Steve