locked
How to download image from DB once thru httphandler, and reuse on several places in page RRS feed

  • Question

  • User-962338856 posted

     Hi there,
    I'm dynamically retrieving images from my db for a messageboard-style page, with the following code.

    <img alt= "../images/anonymous.gif" src='../GetPic.ashx?ID=<%# Eval("UserID") %>'

    Thing is, the assoicated user might show up in several places on the page (if he has more than 1 message). Now I'm sure this it's not a very good practice to reload the same picture from the db, for every message from the same user, on the same page. My question is therefore: how could I reuse the same pic once it's loaded, without resorting to saving it on the file system first and then get it back (might as well reload from the db, then).

    Any ideas guys?

    Appreciate,
    Premy

    Sunday, April 19, 2009 8:54 PM

All replies

  • User1052258516 posted

    You may want to fool around with the Caching features of .NET see #13 on the page

    http://dotnetperls.com/Content/Cache-Examples-ASPNET.aspx

    Sunday, April 19, 2009 10:00 PM
  • User1677448765 posted

     go through this article u wil understand..

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=129

    Sunday, April 19, 2009 10:37 PM
  • User-962338856 posted

    go through this article u wil understand..

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=129

    Well, I don't get it? I wasn't asking about HOW to save and retrieve images, but about how to REUSE the same retrieved image.

    Monday, April 20, 2009 12:54 AM