J
Jordan Richard
Put another way, is there any way I can tell ASP.NET to convert a path
(imbedded in a string variable, "~/images/some_image.gif") to a
root-relative path, that the client will understand, for the *current* page
request?
Here's what I'm doing: I am injecting HTML directly into ASPX pages via
LiteralControl.
something like this...
string myHTMLString =
"<table><tr><td>~/images/some_image.gif</td></tr></table>
litMyLiteral.Text = myHTMLString;
Notice that there is a path to an image in that HTML Table.
As shown, that path to the image obviously won't work because browsers
don't resolve "~" to the root, and ASP.NET doesn't get the opportunity to
convert that to a root-relative path that the client will understand because
it's just a string value from ASP.NET's point of view.
So, how can I have specify the root relative path correctly when injecting a
path (as a string) into a Literal - WHERE that Literal control may be on
ASPX pages in a variety of locations below the site root (i.e, the aspx
pages cannot be assumed to always exist at the root or any level below the
root)?
Thanks.
(imbedded in a string variable, "~/images/some_image.gif") to a
root-relative path, that the client will understand, for the *current* page
request?
Here's what I'm doing: I am injecting HTML directly into ASPX pages via
LiteralControl.
something like this...
string myHTMLString =
"<table><tr><td>~/images/some_image.gif</td></tr></table>
litMyLiteral.Text = myHTMLString;
Notice that there is a path to an image in that HTML Table.
As shown, that path to the image obviously won't work because browsers
don't resolve "~" to the root, and ASP.NET doesn't get the opportunity to
convert that to a root-relative path that the client will understand because
it's just a string value from ASP.NET's point of view.
So, how can I have specify the root relative path correctly when injecting a
path (as a string) into a Literal - WHERE that Literal control may be on
ASPX pages in a variety of locations below the site root (i.e, the aspx
pages cannot be assumed to always exist at the root or any level below the
root)?
Thanks.