Solved

Imagehandler  not working on server

Posted on 2015-01-16
5
10 Views
Last Modified: 2016-07-12
Hi
I have created an Imagehandler (ashx)  "class ImageHandler : IHttpHandler {" that I use in my website.
I use this to display jpeg images on my site. It Works fine when I run the Project from VisualStudio, but when I deploy it to the web server it stops working. I have tried the solution that normaly comes up when I Google this problem:
Add the handler to the handlers section under system.webserver:

"
<add name="ImageHandler_ashx" path="*.ashx" verb="*" type="ImageHandler" preCondition="integratedMode" />

    </handlers>
  </system.webServer>
"
Its Windows server 2008R2 and IIS 7.5
But it doesnt work, I'm i missing something here?
0
Comment
Question by:staleb
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:sudheeshthegreat
ID: 40554802
Is the ImageHandler class part of an assembly that is deployed in the website's bin directory?
It would be better to add the assembly name as well when you mention the type. It should appear as "classname, assemblyname".

Also, make sure that *.ashx does not already have a mapping handler, configured in IIS.
0
 

Author Comment

by:staleb
ID: 40555156
Hi the image handler is not part of an Assembly, it's a separate file that get published.
I tried it in the app_code folder, but now its at the root folder of the website
0
 
LVL 9

Expert Comment

by:sudheeshthegreat
ID: 40557085
I didnt understand when you said it is not part of an assembly, The dll file needs to be placed in the website's bin folder, along with other such dll files of the website.
0
 

Accepted Solution

by:
staleb earned 0 total points
ID: 40557151
Hi
The handler is a .ashx file. and when I publish the web Project it stays as   a .ASHX file. It doesnt get compiled into a .dll.

I think I found the solution:
I didnt have a codebehind file, but I have added one now that I put i the App_code folder, and then the "publish" made an dll of that folder. Now it Works.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now