J
Jarod_24
I got a function that return the url of a image, the problem is that the image control on the .aspx page automaticaly adds the
adress of itself to the adress
Example:
The page http://localhost/myapp/pages/misc/index.aspx calls the function, and it returns the string "images\thumb\001.jpg"
The image control on the page will then point to the adress: http://localhost/myapp/pages/misc/images\thumb\001.jpg (wich is wrong).
The image folder is located at root of my project (myapp) so the adress should be: http://localhost/myapp/images\thumbs\001.jpg
Since the pages could be in different sub-folders at different levels under the myapp folder i can't simply add "..\..\..\" to fix
it.
Is there any function that will return the http://localhost/myapp (the rootof my project folder)?
I tried using System.AppDomain.CurrentDomain.BaseDirectory() but that will return the path as "c:\inetwww\myapp\"
adress of itself to the adress
Example:
The page http://localhost/myapp/pages/misc/index.aspx calls the function, and it returns the string "images\thumb\001.jpg"
The image control on the page will then point to the adress: http://localhost/myapp/pages/misc/images\thumb\001.jpg (wich is wrong).
The image folder is located at root of my project (myapp) so the adress should be: http://localhost/myapp/images\thumbs\001.jpg
Since the pages could be in different sub-folders at different levels under the myapp folder i can't simply add "..\..\..\" to fix
it.
Is there any function that will return the http://localhost/myapp (the rootof my project folder)?
I tried using System.AppDomain.CurrentDomain.BaseDirectory() but that will return the path as "c:\inetwww\myapp\"