Generally this is a really bad idea because this will end up being very,
very slow.
What you might do is have some other process manage a table with the image
links and check them out and write them to a database. This works for either
file or URL based links. With URLs you can use WebClient to check
availability.
You can run this in an external process or fire off a separate background
thread from your ASP.NET application that manages this table of links. You'd
always assume last state until it changes. Obviously this will mean that the
data is not necessarily real time - it'll be only as up to date as the last
link run.
Another approach is have your application manage the image display
directly - have a link or something that can be resolved to a link in your
datagrid in your table that is used for item display and only fill this
value if the image is available. You can either auto-update that using the
same approach above or manually manage the image availabilty...
+++ Rick ---
--
Rick Strahl
West Wind Technologies
www.west-wind.com www.west-wind.com/weblog
"CDWaddell" <CD*******@discussions.microsoft.com> wrote in message
news:D5**********************************@microsof t.com...
I'm trying to write some code to validate if an image is present on the
server. If the image is missing then I want to display out noimage.gif
file.
I have a website that has thousands of products with thousands of images
for
those products. Here's a page with two missing images.
http://dep.teamattire.com/Store/defa...45&SubCatID=75
Many of the images come from other webservers. We do not have the images
locally. I'd like to validate the image as the data grid loads (databound
event).
Any help or guidance is greatly appreciated.
Thanks!