Results 1 to 3 of 3

Thread: Relative Path

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2007
    Posts
    76

    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

  2. #2
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: Relative Path

    Try the Server.MapPath() method.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width