PC Review


Reply
Thread Tools Rate Thread

Check if ImageURL (which is an internet url) exists?

 
 
Mike
Guest
Posts: n/a
 
      1st Mar 2008
Hi. Is there a way programmatically to check if an image control's ImageURL
property (which is an image on the internet) actually exists? I have a 3rd
party company that hosts all the images displayed on my site, and I want to
display a default image if the ImageURL for a specific image doesn't exist.

Thanks!
 
Reply With Quote
 
 
 
 
Jesse Houwing
Guest
Posts: n/a
 
      1st Mar 2008
Hello Mike,

> Hi. Is there a way programmatically to check if an image control's
> ImageURL property (which is an image on the internet) actually exists?
> I have a 3rd party company that hosts all the images displayed on my
> site, and I want to display a default image if the ImageURL for a
> specific image doesn't exist.


You could do a webrequest (would probably be best to just check the headers)
from the server. If it comes back other than 200, it doesn't exist.

You might want to cache the result though... it won't be pretty otherwise...

--
Jesse Houwing
jesse.houwing at sogeti.nl


 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      2nd Mar 2008
Thanks I'll give it a try!

"Jesse Houwing" wrote:

> Hello Mike,
>
> > Hi. Is there a way programmatically to check if an image control's
> > ImageURL property (which is an image on the internet) actually exists?
> > I have a 3rd party company that hosts all the images displayed on my
> > site, and I want to display a default image if the ImageURL for a
> > specific image doesn't exist.

>
> You could do a webrequest (would probably be best to just check the headers)
> from the server. If it comes back other than 200, it doesn't exist.
>
> You might want to cache the result though... it won't be pretty otherwise...
>
> --
> Jesse Houwing
> jesse.houwing at sogeti.nl
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check whether URL exists Greg Lovern Microsoft Excel Programming 1 15th Mar 2011 11:13 PM
DSN, Check if exists Bernie Hunt Microsoft ADO .NET 2 10th Apr 2006 04:40 PM
Check url exists Pete Microsoft ASP .NET 1 29th Nov 2004 04:13 PM
Check to see if Doc exists Ryan Microsoft Access Form Coding 7 14th Nov 2003 10:19 PM
check if url exists tom Microsoft Dot NET 1 11th Sep 2003 10:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:29 AM.