absolute path to ImageUrl property .....

Discussion in 'ASP .Net' started by Adam Right, Jan 28, 2008.

  1. Adam Right

    Adam Right Guest

    Hi All,

    I'm developping a site using VS2008 (c#) on IIS 6.0.
    In my application images are not shown by the image control, they are in the
    web server machine and the main folder path is E:\PICTURES.

    If I set the ImageURL property in the code and set it to the absolute path
    of the image, it doesn't show.

    Is it possible to set ImageUrl property for absolute path of a image file,
    like that...

    Image1.ImageUrl = E:\PICTURES\products\st750-4.png

    Any tips?

    Thanks.

    Adam...
     
    Adam Right, Jan 28, 2008
    #1
    1. Advertising

  2. It must be a virtual path. In other words, relative to the application web
    directory, like Images/myImage.gif

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Adam Right" <AdamRight> wrote in message
    news:...
    > Hi All,
    >
    > I'm developping a site using VS2008 (c#) on IIS 6.0.
    > In my application images are not shown by the image control, they are in
    > the web server machine and the main folder path is E:\PICTURES.
    >
    > If I set the ImageURL property in the code and set it to the absolute path
    > of the image, it doesn't show.
    >
    > Is it possible to set ImageUrl property for absolute path of a image file,
    > like that...
    >
    > Image1.ImageUrl = E:\PICTURES\products\st750-4.png
    >
    > Any tips?
    >
    > Thanks.
    >
    > Adam...
    >
    >
    >
     
    Eliyahu Goldin, Jan 28, 2008
    #2
    1. Advertising

  3. Adam Right

    Patrice Guest

    Keep in mind that the location of the image is used client side in your
    browser. Your browser won't be able to get an image that is stored outside
    of your web site on your web server harddrive (my understanding is that the
    E:\PICTURES location is not under your web site).

    You could use a handler or an ASPX page that will read the content of this
    file server side to stream this content to the browser...

    Try for example :
    http://msdn.microsoft.com/msdnmag/issues/04/04/CuttingEdge/

    If making those images not reachable is not what you intended (or if I
    misunderstood the situation) you could just create a virtual folder to this
    location and then use ~/myfolder/products/whatever.png) so that they are
    available using a particular URL...

    --
    Patrice


    "Adam Right" <AdamRight> a écrit dans le message de news:
    ...
    > Hi All,
    >
    > I'm developping a site using VS2008 (c#) on IIS 6.0.
    > In my application images are not shown by the image control, they are in
    > the web server machine and the main folder path is E:\PICTURES.
    >
    > If I set the ImageURL property in the code and set it to the absolute path
    > of the image, it doesn't show.
    >
    > Is it possible to set ImageUrl property for absolute path of a image file,
    > like that...
    >
    > Image1.ImageUrl = E:\PICTURES\products\st750-4.png
    >
    > Any tips?
    >
    > Thanks.
    >
    > Adam...
    >
    >
    >
     
    Patrice, Jan 28, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    3
    Views:
    19,578
    Sudsy
    Jul 8, 2004
  2. Replies:
    10
    Views:
    3,602
  3. Thomas Guettler
    Replies:
    3
    Views:
    765
    Andrei
    Oct 27, 2003
  4. Adam Right

    absolute path to ImageUrl property .....

    Adam Right, Jan 28, 2008, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    389
    Eliyahu Goldin
    Jan 28, 2008
  5. James Byrne
    Replies:
    3
    Views:
    570
    James Byrne
    Sep 14, 2010
Loading...

Share This Page