locked
What's the difference between httphandlers and handlers in web.config RRS feed

  • Question

  • User778485240 posted

    Hi All,

    Question is in the subject.

    I can't find a simple answer on google, they both sound like they do the same thing.

    I'm studying for my web development exam and although I generally pick the correct answer when both of these show up as an option, I'm never really sure why.

    Saturday, June 25, 2011 11:37 AM

All replies

  • User-451260051 posted

    Can you re-state that question?  What are you asking?

    Saturday, June 25, 2011 11:39 AM
  • User778485240 posted

    sorry just updated it, this forum doesn't like left and right angle brackets :)

    Saturday, June 25, 2011 11:46 AM
  • User-451260051 posted

    As far as I know, there is no difference between the two.  This is illustrated in the MSDN article for HttpHandlers:
    http://msdn.microsoft.com/en-us/library/46c5ddfy.aspx

    and the IIS article on Handlers:
    http://www.iis.net/ConfigReference/system.webServer/handlers

    If you look at the code samples, they are almost identical

    IIS:

    <handlers>
       <add name="SampleHandler" verb="*" 
          path="SampleHandler.new" 
          type="SampleHandler, SampleHandlerAssembly" 
          resourceType="Unspecified" />
    </handlers>

    MSDN:
    <httpHandlers>
          <add verb="*" path="SampleHandler.new" 
            type="SampleHandler, SampleHandlerAssembly" />
        </httpHandlers>

    Hope that helps.
    Saturday, June 25, 2011 12:06 PM
  • User-115762274 posted

    @tehremo: Yes, they are very similar in syntax, but there certainly are significant differences.

    Foremost, the httpHandlers element is used on sites running on IIS 5 – 6, or IIS 7.x in Classic mode (IIS 6 compatibility mode).  The handlers element is used on sites running on IIS 7.x (Integrated mode).

    You can have both in a Web.config, which would make sense if you develop against one version of IIS and deploy to another, for example.

    Wednesday, December 21, 2011 1:42 PM