img src="~/"

R

RedHair

When use src="~/..." for a img server control will render a relative path to
client, is it possible to return a absolute path?
Otherwise, I need to assgin it with resolveUrl("~/...")
 
M

Mark Rae

When use src="~/..." for a img server control will render a relative path
to
client, is it possible to return a absolute path?
Otherwise, I need to assgin it with resolveUrl("~/...")

Request.ServerVariables["APPL_PHYSICAL_PATH"].ToString();

should return the absolute path on the webserver to your app's virtual
root...

There are several other ways of doing the above...
 
R

RedHair

I can assign the path to the control directly?
<asp:Image ImageUrl=".." />


Mark Rae said:
When use src="~/..." for a img server control will render a relative path
to
client, is it possible to return a absolute path?
Otherwise, I need to assgin it with resolveUrl("~/...")

Request.ServerVariables["APPL_PHYSICAL_PATH"].ToString();

should return the absolute path on the webserver to your app's virtual
root...

There are several other ways of doing the above...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,096
Latest member
ThurmanCre

Latest Threads

Top