-
Relative Path
I have a flower.gif file in the given folder "C:\documents and settings\abc\Visual studio\Proj\namecontrol"
Now that on the client side, button click of an event calls this image. How to set relative path to this so that it can accessed from anywhere.
I have tried Environment.CurrentDirectory and as well as System.Reflection.Assembly.GetAssembly() methods, both did not produce the result that i need.
All that i want is to access the applciation path which is "C:\documents and settings\abc\Visual studio\Proj\" as relative path from client side
-
Re: Relative Path
Try the Server.MapPath() method.
-
Re: Relative Path
If "C:\documents and settings\abc\Visual studio\Proj\" is not mapped under IIS, then you cannot set a relative path to it.
You will need to either place this image you need in your virtual directory under the 'images' folder, or create a dynamic ASP.NET page that serves up an image by reading from the specified file location. The first option is easier