Httphandler doesn't engage for non-home pages?

Try this: img src="/ImageLib. Axd? Image=img001.

Jpg" alt="real image here The fundamental problem is that you are relatively referencing ImageLib.axd. A browser will try to access it from wherever it is...in your case, when it requests the image, it is requesting it from http://whatever/controller/action/ImageLib. Axd I am assuming you need it to request from http://whatever/ImageLib.

Axd Note that simply adding the preceeding whack (/) is not necessarily going to solve your problem. If ImageLib. Axd is in some sub folder off of your root, you would have to include that.

If your ImageLib. Axd handler is in a folder called handlers off of your web site root, you would do the following: img src="/Handlers/ImageLib. Axd?

Image=img001. Jpg" alt="real image here.

Try this: The fundamental problem is that you are relatively referencing ImageLib.axd. A browser will try to access it from wherever it is...in your case, when it requests the image, it is requesting it from whatever/controller/action/ImageLib.axd. I am assuming you need it to request from http://whatever/ImageLib.axd.

Note that simply adding the preceeding whack (/) is not necessarily going to solve your problem. If ImageLib. Axd is in some sub folder off of your root, you would have to include that.

If your ImageLib. Axd handler is in a folder called handlers off of your web site root, you would do the following.

OK, simply adding preceding slash did work. I am not sure about the second part - I don't have physical Image.axd. I think that Image.

Axd is mapped to ImageHandler, that is included in ImageUtil. Dll that is included as reference. I guess, it is implied to be in the root; therefore slash solves the problem.

Thank you very much! – Felix Mar 2 '10 at 4:39 Ah, yeah, not all . Axd handlers have an actual .

Axd file...kind of depends on the implementation. Glad the solution worked. :) – jrista Mar 2 '10 at 4:40.

You need to route the request for images to your httpHandler, but mvc is is intercepting the requests and trying to route to a controller action. You can configure this in your Global. Asax or if you're implementing your own HttpApplication on the OnStart() method as follow: routes.

IgnoreRoute("{*allaxd}", new {allaxd=@". *\. Axd(/.

*)? "}); // or make sure you have this routes. IgnoreRoute("{resource}.

Axd/{*pathInfo}"); You can find more info on a post by Phil Haack here http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx.

Dax70, thank you for your suggestion. I have this line (I guess, it's put in RegisterRoutes() when MVC project is generated). Also, I am not sure how this suggestion applies to my situation - since I do get the httphandler invoked for root pages.

– Felix Mar 2 '10 at 5:00.

I have an MVC2 application, and HttpHandler Library. The library, to simplify, serves an image. The problem is that if I invoke this handler from the root page ( http://whatever/ ), everything works fine.

If, however, I change the Global. Asax, so the same page now has the address of http://whatever/controller/action - it doesn't work (ALT text comes out instead of image). I didn't write the handler library, but I have the code; so I put a breakpoint in ProcessRequest function of IHttpHandler implementation.

For good situation the breakpoint gets triggered, but for bad case it isn't. So, I assume that the handler isn't invoked for non-root pages. This is what I have in system.

I don't know if MVC plays any role in it... the old WebForms application works fine with the same settings. Hopefully, I provided all that I know. Of course, if something isn't clear, I'll be happy to explain as much as I can!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions