0

我正在路由我的图像并通过 imageRouteHandler 调整它们的大小。这是代码。

 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;
        }
    }

我收到此错误,

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

据我所知,WebImage.Write()将写信给回复。这里还需要什么?

4

1 回答 1

0

添加

requestContext.HttpContext.Response.End();

之前return null;的伎俩。

于 2015-01-09T10:48:30.660 回答