473,378 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

using ~ (virtual path) with images

I made a header control in asp.net and it references images in the /images/
folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the controls
to load using the ~/tempates/ctrlHeader thing in the references section of
the page that uses them, but I need that same idea in the actual control so
it knows to refrence the image folder no mater where the page its doing it
from is located in the site... how can i do this? is there a way to use the
~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img
Nov 18 '05 #1
21 1055
"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the /images/ folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the controls to load using the ~/tempates/ctrlHeader thing in the references section of
the page that uses them, but I need that same idea in the actual control so it knows to refrence the image folder no mater where the page its doing it
from is located in the site... how can i do this? is there a way to use the ~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img


Perhaps you should give an example of what you're talking about.
--
John Saunders
John.Saunders at SurfControl.com

Nov 18 '05 #2
"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the /images/ folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the controls to load using the ~/tempates/ctrlHeader thing in the references section of
the page that uses them, but I need that same idea in the actual control so it knows to refrence the image folder no mater where the page its doing it
from is located in the site... how can i do this? is there a way to use the ~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img


Perhaps you should give an example of what you're talking about.
--
John Saunders
John.Saunders at SurfControl.com

Nov 18 '05 #3
If I understand your situation right, it should work if you make sure the
<img> tag runs on the server, and then use the ~ notation to get to the
images subdir,

e.g. <img src="~/images/pic.jpg" runat=server>

HTH,
Pete Beech

"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the /images/ folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the controls to load using the ~/tempates/ctrlHeader thing in the references section of
the page that uses them, but I need that same idea in the actual control so it knows to refrence the image folder no mater where the page its doing it
from is located in the site... how can i do this? is there a way to use the ~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img

Nov 18 '05 #4
If I understand your situation right, it should work if you make sure the
<img> tag runs on the server, and then use the ~ notation to get to the
images subdir,

e.g. <img src="~/images/pic.jpg" runat=server>

HTH,
Pete Beech

"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the /images/ folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the controls to load using the ~/tempates/ctrlHeader thing in the references section of
the page that uses them, but I need that same idea in the actual control so it knows to refrence the image folder no mater where the page its doing it
from is located in the site... how can i do this? is there a way to use the ~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img

Nov 18 '05 #5
Hi Brian,

The ~ syntax works with ASP.Net controls etc. but if you build your own URLs
this obviously won't work.

Take a look at this BLOG entry:

http://west-wind.com/weblog/posts/269.aspx

which talks about the various ASP.Net paths and also provides a generic
routine that lets you properly expand your own Urls using the ~ syntax.

Regards,

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:#7**************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the /images/ folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the controls to load using the ~/tempates/ctrlHeader thing in the references section of
the page that uses them, but I need that same idea in the actual control so it knows to refrence the image folder no mater where the page its doing it
from is located in the site... how can i do this? is there a way to use the ~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img

Nov 18 '05 #6
Hi Brian,

The ~ syntax works with ASP.Net controls etc. but if you build your own URLs
this obviously won't work.

Take a look at this BLOG entry:

http://west-wind.com/weblog/posts/269.aspx

which talks about the various ASP.Net paths and also provides a generic
routine that lets you properly expand your own Urls using the ~ syntax.

Regards,

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:#7**************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the /images/ folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the controls to load using the ~/tempates/ctrlHeader thing in the references section of
the page that uses them, but I need that same idea in the actual control so it knows to refrence the image folder no mater where the page its doing it
from is located in the site... how can i do this? is there a way to use the ~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img

Nov 18 '05 #7
thanks! that works great for img tag's.. is there anyway to also do this
with backgrounds of tables? runat=server doesnt seem to work on td tags with
background = "~/images/img.gif"

thanks!
"Pete Beech" <pe*********@hotmail.nojunk.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
If I understand your situation right, it should work if you make sure the
<img> tag runs on the server, and then use the ~ notation to get to the
images subdir,

e.g. <img src="~/images/pic.jpg" runat=server>

HTH,
Pete Beech

"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the

/images/
folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the

controls
to load using the ~/tempates/ctrlHeader thing in the references section of the page that uses them, but I need that same idea in the actual control

so
it knows to refrence the image folder no mater where the page its doing it from is located in the site... how can i do this? is there a way to use

the
~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img


Nov 18 '05 #8
thanks! that works great for img tag's.. is there anyway to also do this
with backgrounds of tables? runat=server doesnt seem to work on td tags with
background = "~/images/img.gif"

thanks!
"Pete Beech" <pe*********@hotmail.nojunk.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
If I understand your situation right, it should work if you make sure the
<img> tag runs on the server, and then use the ~ notation to get to the
images subdir,

e.g. <img src="~/images/pic.jpg" runat=server>

HTH,
Pete Beech

"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the

/images/
folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the

controls
to load using the ~/tempates/ctrlHeader thing in the references section of the page that uses them, but I need that same idea in the actual control

so
it knows to refrence the image folder no mater where the page its doing it from is located in the site... how can i do this? is there a way to use

the
~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img


Nov 18 '05 #9
Hey Brian,

Don't forget the ASP.NET Table control...

<asp:Table id="Table1" runat="server" BorderWidth=1
BackImageUrl="~/images/floor.jpg">
<asp:TableRow>
<asp:TableCell>Hello</asp:TableCell>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
<asp:TableRow></asp:TableRow>
<asp:TableRow></asp:TableRow>
</asp:Table>

Ken
Microsoft MVP [ASP.NET]
"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
thanks! that works great for img tag's.. is there anyway to also do this
with backgrounds of tables? runat=server doesnt seem to work on td tags
with
background = "~/images/img.gif"

thanks!
"Pete Beech" <pe*********@hotmail.nojunk.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
If I understand your situation right, it should work if you make sure the
<img> tag runs on the server, and then use the ~ notation to get to the
images subdir,

e.g. <img src="~/images/pic.jpg" runat=server>

HTH,
Pete Beech

"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
> I made a header control in asp.net and it references images in the

/images/
> folder in the virtural path's root folder... How can I get the header
> control to show the images at any level of the web site? i got the

controls
> to load using the ~/tempates/ctrlHeader thing in the references section of > the page that uses them, but I need that same idea in the actual
> control

so
> it knows to refrence the image folder no mater where the page its doing it > from is located in the site... how can i do this? is there a way to use

the
> ~ in the img src? thanks
>
> example structure of this
>
> / root
> |--- images
> |--- controls for header etc...
> | -- main page.html
> |--- new pages in folder
> | --- sub page 1.. references control header and img
>
>




Nov 18 '05 #10
Hey Brian,

Don't forget the ASP.NET Table control...

<asp:Table id="Table1" runat="server" BorderWidth=1
BackImageUrl="~/images/floor.jpg">
<asp:TableRow>
<asp:TableCell>Hello</asp:TableCell>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
<asp:TableRow></asp:TableRow>
<asp:TableRow></asp:TableRow>
</asp:Table>

Ken
Microsoft MVP [ASP.NET]
"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
thanks! that works great for img tag's.. is there anyway to also do this
with backgrounds of tables? runat=server doesnt seem to work on td tags
with
background = "~/images/img.gif"

thanks!
"Pete Beech" <pe*********@hotmail.nojunk.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
If I understand your situation right, it should work if you make sure the
<img> tag runs on the server, and then use the ~ notation to get to the
images subdir,

e.g. <img src="~/images/pic.jpg" runat=server>

HTH,
Pete Beech

"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
> I made a header control in asp.net and it references images in the

/images/
> folder in the virtural path's root folder... How can I get the header
> control to show the images at any level of the web site? i got the

controls
> to load using the ~/tempates/ctrlHeader thing in the references section of > the page that uses them, but I need that same idea in the actual
> control

so
> it knows to refrence the image folder no mater where the page its doing it > from is located in the site... how can i do this? is there a way to use

the
> ~ in the img src? thanks
>
> example structure of this
>
> / root
> |--- images
> |--- controls for header etc...
> | -- main page.html
> |--- new pages in folder
> | --- sub page 1.. references control header and img
>
>




Nov 18 '05 #11
No, Brian, it won't work with tables. You can do something like this...

<table background='<%=ResolveUrl("~/images/image.jpg")%>'>
.... rest of table goes here
HTH
Brian W


"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
thanks! that works great for img tag's.. is there anyway to also do this
with backgrounds of tables? runat=server doesnt seem to work on td tags with background = "~/images/img.gif"

thanks!
"Pete Beech" <pe*********@hotmail.nojunk.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
If I understand your situation right, it should work if you make sure the
<img> tag runs on the server, and then use the ~ notation to get to the
images subdir,

e.g. <img src="~/images/pic.jpg" runat=server>

HTH,
Pete Beech

"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the /images/
folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the

controls
to load using the ~/tempates/ctrlHeader thing in the references
section of the page that uses them, but I need that same idea in the actual
control so
it knows to refrence the image folder no mater where the page its
doing
it from is located in the site... how can i do this? is there a way to

use the
~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img



Nov 18 '05 #12
No, Brian, it won't work with tables. You can do something like this...

<table background='<%=ResolveUrl("~/images/image.jpg")%>'>
.... rest of table goes here
HTH
Brian W


"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
thanks! that works great for img tag's.. is there anyway to also do this
with backgrounds of tables? runat=server doesnt seem to work on td tags with background = "~/images/img.gif"

thanks!
"Pete Beech" <pe*********@hotmail.nojunk.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
If I understand your situation right, it should work if you make sure the
<img> tag runs on the server, and then use the ~ notation to get to the
images subdir,

e.g. <img src="~/images/pic.jpg" runat=server>

HTH,
Pete Beech

"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the /images/
folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the

controls
to load using the ~/tempates/ctrlHeader thing in the references
section of the page that uses them, but I need that same idea in the actual
control so
it knows to refrence the image folder no mater where the page its
doing
it from is located in the site... how can i do this? is there a way to

use the
~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img



Nov 18 '05 #13
thanks, all your comments helped a lot

"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
No, Brian, it won't work with tables. You can do something like this...

<table background='<%=ResolveUrl("~/images/image.jpg")%>'>
... rest of table goes here
HTH
Brian W


"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
thanks! that works great for img tag's.. is there anyway to also do this
with backgrounds of tables? runat=server doesnt seem to work on td tags

with
background = "~/images/img.gif"

thanks!
"Pete Beech" <pe*********@hotmail.nojunk.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
If I understand your situation right, it should work if you make sure the <img> tag runs on the server, and then use the ~ notation to get to the images subdir,

e.g. <img src="~/images/pic.jpg" runat=server>

HTH,
Pete Beech

"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
> I made a header control in asp.net and it references images in the
/images/
> folder in the virtural path's root folder... How can I get the header > control to show the images at any level of the web site? i got the
controls
> to load using the ~/tempates/ctrlHeader thing in the references section
of
> the page that uses them, but I need that same idea in the actual

control so
> it knows to refrence the image folder no mater where the page its doing
it
> from is located in the site... how can i do this? is there a way to

use the
> ~ in the img src? thanks
>
> example structure of this
>
> / root
> |--- images
> |--- controls for header etc...
> | -- main page.html
> |--- new pages in folder
> | --- sub page 1.. references control header and img
>
>



Nov 18 '05 #14
thanks, all your comments helped a lot

"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
No, Brian, it won't work with tables. You can do something like this...

<table background='<%=ResolveUrl("~/images/image.jpg")%>'>
... rest of table goes here
HTH
Brian W


"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
thanks! that works great for img tag's.. is there anyway to also do this
with backgrounds of tables? runat=server doesnt seem to work on td tags

with
background = "~/images/img.gif"

thanks!
"Pete Beech" <pe*********@hotmail.nojunk.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
If I understand your situation right, it should work if you make sure the <img> tag runs on the server, and then use the ~ notation to get to the images subdir,

e.g. <img src="~/images/pic.jpg" runat=server>

HTH,
Pete Beech

"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
> I made a header control in asp.net and it references images in the
/images/
> folder in the virtural path's root folder... How can I get the header > control to show the images at any level of the web site? i got the
controls
> to load using the ~/tempates/ctrlHeader thing in the references section
of
> the page that uses them, but I need that same idea in the actual

control so
> it knows to refrence the image folder no mater where the page its doing
it
> from is located in the site... how can i do this? is there a way to

use the
> ~ in the img src? thanks
>
> example structure of this
>
> / root
> |--- images
> |--- controls for header etc...
> | -- main page.html
> |--- new pages in folder
> | --- sub page 1.. references control header and img
>
>



Nov 18 '05 #15
Jos
"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the /images/ folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the controls to load using the ~/tempates/ctrlHeader thing in the references section of
the page that uses them, but I need that same idea in the actual control so it knows to refrence the image folder no mater where the page its doing it
from is located in the site... how can i do this? is there a way to use the ~ in the img src? thanks

Yes. Add the attribute runat="server" to the <img> tag.
Of course, this will only work in .aspx files, not in .htm or .html files.

--

Jos
Nov 18 '05 #16
Jos
"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the /images/ folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the controls to load using the ~/tempates/ctrlHeader thing in the references section of
the page that uses them, but I need that same idea in the actual control so it knows to refrence the image folder no mater where the page its doing it
from is located in the site... how can i do this? is there a way to use the ~ in the img src? thanks

Yes. Add the attribute runat="server" to the <img> tag.
Of course, this will only work in .aspx files, not in .htm or .html files.

--

Jos
Nov 18 '05 #17
Hi Rick,
I had a quick look at your blog entry - I think ResolveURL will do the same
as your function, with regard to ~'s at the start of the URL.

Pete

"Rick Strahl [MVP]" <ri********@hotmail.com> wrote in message
news:OC**************@TK2MSFTNGP10.phx.gbl...
Hi Brian,

The ~ syntax works with ASP.Net controls etc. but if you build your own URLs this obviously won't work.

Take a look at this BLOG entry:

http://west-wind.com/weblog/posts/269.aspx

which talks about the various ASP.Net paths and also provides a generic
routine that lets you properly expand your own Urls using the ~ syntax.

Regards,

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:#7**************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the

/images/
folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the

controls
to load using the ~/tempates/ctrlHeader thing in the references section of the page that uses them, but I need that same idea in the actual control

so
it knows to refrence the image folder no mater where the page its doing it from is located in the site... how can i do this? is there a way to use

the
~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img


Nov 18 '05 #18
Hi Rick,
I had a quick look at your blog entry - I think ResolveURL will do the same
as your function, with regard to ~'s at the start of the URL.

Pete

"Rick Strahl [MVP]" <ri********@hotmail.com> wrote in message
news:OC**************@TK2MSFTNGP10.phx.gbl...
Hi Brian,

The ~ syntax works with ASP.Net controls etc. but if you build your own URLs this obviously won't work.

Take a look at this BLOG entry:

http://west-wind.com/weblog/posts/269.aspx

which talks about the various ASP.Net paths and also provides a generic
routine that lets you properly expand your own Urls using the ~ syntax.

Regards,

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:#7**************@TK2MSFTNGP10.phx.gbl...
I made a header control in asp.net and it references images in the

/images/
folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the

controls
to load using the ~/tempates/ctrlHeader thing in the references section of the page that uses them, but I need that same idea in the actual control

so
it knows to refrence the image folder no mater where the page its doing it from is located in the site... how can i do this? is there a way to use

the
~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
| --- sub page 1.. references control header and img


Nov 18 '05 #19
"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
No, Brian, it won't work with tables. You can do something like this...

<table background='<%=ResolveUrl("~/images/image.jpg")%>'>
... rest of table goes here


Why wouldn't the following work:

<table runat="server" background="~/images/image.jpg">
....
</table>
--
John Saunders
John.Saunders at SurfControl.com

Nov 18 '05 #20
Why should it.
It works only in a handful amount of methods.
If some processing of the path is required then it works. If it's just a
property you set then it does not.

George.
"John Saunders" <john.saunders at SurfControl.com> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
No, Brian, it won't work with tables. You can do something like this...

<table background='<%=ResolveUrl("~/images/image.jpg")%>'>
... rest of table goes here


Why wouldn't the following work:

<table runat="server" background="~/images/image.jpg">
...
</table>
--
John Saunders
John.Saunders at SurfControl.com

Nov 18 '05 #21
Actually, it has to do with how the HTML server control was implemented.
Whoever wrote the code for System.Web.UI.HtmlControls.HtmlTable chose not to
resolve the path before rendering.
Regards
Brian W

"John Saunders" <john.saunders at SurfControl.com> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
No, Brian, it won't work with tables. You can do something like this...

<table background='<%=ResolveUrl("~/images/image.jpg")%>'>
... rest of table goes here


Why wouldn't the following work:

<table runat="server" background="~/images/image.jpg">
...
</table>
--
John Saunders
John.Saunders at SurfControl.com

Nov 18 '05 #22

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Scott Tilton | last post by:
We have a field that gets filled into a database that our ASP website pulls from. What we would like to be able to do is to take that path and convert it to a virtual path so the website can...
2
by: Jeffry van de Vuurst | last post by:
Hi, (sorry for the crosspost, I wasn't sure which was the best place to put this). I was just thinking about something and wondered if any of you has some ideas about this. I'm using the...
0
by: Dwaine | last post by:
I got stumpped on this a while back and used a workaround that involved the "same local username/pwd on both servers" method. Now I'd like to find a cleaner method.... The setup: A webApp...
12
by: Brian Henry | last post by:
I made a header control in asp.net and it references images in the /images/ folder in the virtural path's root folder... How can I get the header control to show the images at any level of the web...
4
by: tommaso.gastaldi | last post by:
Hi friends I was in the need to find a sort of "definitive" :) solution to transform a virtual path such as "~/MyDir/MyFile into a full web address. In particular I needed it * within web...
8
by: JJ | last post by:
I'm confused about paths. I have a functionn that uses the mappath method, which I think requires a virtual path (is that the same as a relative path?). But this doesn't always work as the...
5
by: marss | last post by:
Server.MapPath("~/page.aspx") returns the physical file path based on the specified virtual path. Is there any reverse method to get the virtual path based on the physical path (both pathes belong...
7
by: jain2005k | last post by:
How can I rename a .jpg file in server using asp( not asp.net) code I use the FileSystemObject to do that like Fso = Server.CreateObject("Scripting.FileSystemObject");...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.