Using Peter's technique, you could also make a nice site-wide solution using
an HttpModule (or an HttpHandler). There, you would determine if the file
is an image request (.jpg, .jpeg, .gif, .png, .bmp, etc.), and use
System.IO.File.Exist () to determine whether the file is real. If not, you
can Rewrite the Url to point at your placeholder file.
An alternate possibility is to just database the list of photos, and check
there first.
/// M
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:#W**************@TK2MSFTNGP11.phx.gbl...
If these images are locale to your machine, you could probably just use
the File.Exist method to determine if that file exists. If these are remote
images, then you will have to use the HttpWebRequest/HttpWebResponse to
try to download the image. If the response is something like a 404, then you
can swap in your substitute image.
"EMW" <so*****@MikroZoft.com> wrote in message
news:41**********************@dreader2.news.tiscal i.nl... Hi,
My ASPX (vb.NET) page needs to check an URL.
if it exists then it shows the picture (url is to that picture)
if is doesn't exist, it must show another picture.
but the question is how do I know wheater the URL is valid?
I use a Image webcontrol and that doesn't let me know the picture cannot
be found, it just shows the red x.
rg.
Eric