Theme: default | dark | nature

ThumbnailHandler

Download Download

A really easy way to dynamically create image thumbnails using an HTTP Handler!

In your web.config file, add a section like this:

<?xml version="1.0"?>
<system.web>
    <httpHandlers>
        <add verb="GET" path="Thumbnail.axd" validate="false" type="GLC.Tools.Handlers.ThumbnailHandler, GLC.Tools"/>
    </httpHandlers>
...
</system.web>

To use the handler, you can reference it in an image tag or link to it directly like:

<img src="Thumbnail.axd?image=/path/to/my/image.jpg&max=100" />

You must specify the parameter image. You can optionally specify the maximum dimension (width or height depending on orientation) for the thumbnail as max in pixels. The default value is 120 (pixels).

Contact us today! Free consulting with no obligation.