jeudi 2 juillet 2015

IRouteHandler not routing through RouteConfig

I have a IRouteHander class which I use to resize images on the fly and add expire headers to them, Recently I moved to MVC5 and now updating my code. I tried to register the same route for that class in RouteConfig.cs

routes.Add(new Route("Image/{w}/{h}/{src}", new ThumbImageRouteHandler()));

but this route isn't working anymore like it was on MVC3. Is there anything I am missing here? this route leads to

public class ThumbImageRouteHandler : IRouteHandler
{
         public IHttpHandler GetHttpHandler(RequestContext requestContext)
            {
                HttpHanler httpHandler = new HttpHanler();
                return httpHandler;
            }
            public class HttpHanler : IHttpHandler
            {
                public bool IsReusable
                {
                    get
                    {
                        return false;
                    }
                }
                public void ProcessRequest(HttpContext context)
                {
                //Do something
                }
               }
           }
}

Please help me fixing this issue. Thanks

Aucun commentaire:

Enregistrer un commentaire