473,395 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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!
Mar 1 '08 #1
2 3002
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
Mar 1 '08 #2
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
Mar 2 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Matt | last post by:
Is there a way to use JavaScript to check if a file path exists? For example, user enter C:\eklrjlejr in a text box, and I want to check if the file really exists. Is there a way to use JavaScript...
3
by: Jonny | last post by:
Hi, Please could you tell me how to check for an internet connection in C. I'm using Windows 2000. Many Thanks, Jonny
9
by: Leigh Kendall | last post by:
I can't find any issue in the MS KB, but I'm experiencing the following problem which seems to be specific to IE5, and NOT any other version of IE 5.5+ or NN 6+. Issue: I'm using an asp.net...
1
by: Nathan Sokalski | last post by:
I am using the ImageUrl property of the Hyperlink control to create a graphical Hyperlink. However, I want to change the size of the image I am using, but the generated HTML places the width/height...
4
by: Ben | last post by:
Hi, I'm using images in my menu control. I have my menu setup based on this example: http://msdn2.microsoft.com/en-US/library/system.web.ui.webcontrols.menuitembinding.imageurlfield(VS.80).aspx ...
3
by: Thomas Satzinger | last post by:
Hallo., i just encounterd a strange thing which i cannot resolve. I am saving a bitmap created in memory to the asp temp folder (asp.net 2.0) this works fine, and i donīt want to create an...
0
by: Jeff | last post by:
Hey ASP.NET 2.0 I'm working on a website which I want the menu control to have images to left for the text in the menuitem... So far I've read that this can be done by providing the ImageUrl...
1
by: wardemon | last post by:
Hi, I have an image control which inside an ItemTemplate of a GridView Control. I've coded the ImageControl's ImageURL in "Source" to have a dynamically filled-up value ex: ImageURL = <%#...
5
by: OK | last post by:
I am using an image control to display some images within a virtual map (ImagesRoot in IIS) outside of the web root in my vb asp.net application. How should I code the imageurl property to have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.