absolute path to ImageUrl property .....

absolute path to ImageUrl property .....

am 28.01.2008 14:42:50 von Adam Right

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...

Re: absolute path to ImageUrl property .....

am 28.01.2008 15:03:52 von Eliyahu Goldin

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" wrote in message
news:OvfG5ObYIHA.3400@TK2MSFTNGP03.phx.gbl...
> 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...
>
>
>

Re: absolute path to ImageUrl property .....

am 28.01.2008 15:03:52 von Eliyahu Goldin

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" wrote in message
news:OvfG5ObYIHA.3400@TK2MSFTNGP03.phx.gbl...
> 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...
>
>
>

Re: absolute path to ImageUrl property .....

am 28.01.2008 15:58:45 von Patrice

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" a écrit dans le message de news:
OvfG5ObYIHA.3400@TK2MSFTNGP03.phx.gbl...
> 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...
>
>
>

Re: absolute path to ImageUrl property .....

am 28.01.2008 15:58:45 von Patrice

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" a écrit dans le message de news:
OvfG5ObYIHA.3400@TK2MSFTNGP03.phx.gbl...
> 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...
>
>
>