Solved

Imagehandler  not working on server

Posted on 2015-01-16
5
27 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

617 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