I am using asp:image field to get an image from different urls. I use the imageurl to set the image string from the remote website(ex: http://www.google.com/favicon.ico), the question is how can I tell if the image exist or not? that mean that the Url of the image is valid.
Share
You can validate if a URI is valid using the Uri.TryCreate method.
You shouldn’t be checking whether the image exists in your ASP.Net application. It is the job of the browser to download the image. You can add javascript to allow the browser to replace the missing image with a default image, as described in this question.