How to handle null return from custom HttpHandler in asp.net?

Posted by Campos on Stack Overflow See other posts from Stack Overflow or by Campos
Published on 2010-06-08T17:54:59Z Indexed on 2010/06/08 18:02 UTC
Read the original article Hit count: 220

I'm using a custom ashx HttpHandler to retrieve gif images from a database and show it on a website - when the image exists, it works great.

However, there are cases when the image will not exist, and I'd like to have the html table holding the image to become invisible so the "image not found" icon is not shown.

But since the HttpHandler is not synchronous, all my attempts checking for image size at Page_Load were frustrated. Any ideas on how this can be accomplished?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET