0

I am routing my image and resizing them thru an imageRouteHandler. Here is the code.

 public class ImageRouteHandler : IRouteHandler
    {
        public IHttpHandler GetHttpHandler(RequestContext requestContext)
        {
            var filePath="(from Request Context)"
            var image = new WebImage(filePath);
            image = image.Resize(width, height);
            image.Write();
            return null;
        }
    }

I am getting this error,

The route handler '...ImageRouteHandler' did not return an IHttpHandler from its GetHttpHandler() method.

the WebImage.Write() will write to the response as i know. What else is needed here?

Ruchan
  • 3,124
  • 7
  • 36
  • 72

1 Answers1

0

Adding

requestContext.HttpContext.Response.End();

before return null; did the trick.

Ruchan
  • 3,124
  • 7
  • 36
  • 72