HttpHandler not working :-)

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default HttpHandler not working :-)

    I have a simple HttpHandler
    //--
    using System.Web;
    namespace Acme {
    public class SimpleHandler : IHttpHandler {
    public void ProcessRequest(HttpContext context) {
    context.Response.Write("Hello World!");
    }

    public bool IsReusable {
    get {
    return true;
    }
    }
    }
    }
    //--
    I add in the web config file (perso/Web.config) this simple lines:
    //--
    <httpHandlers>
    <add verb="*"
    path="simple.aspx"
    type="perso.FileService, perso"/>
    </httpHandlers>
    //--

    but when I type ' [url]http://localhost/simple.aspx[/url] ' or '
    [url]http://localhost/perso/simple.aspx[/url] ' I have an error 404.
    I know that my HttpHandler is registered because if I put incorrect value in
    the config file I get the error page. however I never go into my handler (I
    put some call to Trace.Write() in it, to be sure ...)

    any tip ? advice ? experience ? whatever ?


    Lloyd Dupont Guest

  2. Similar Questions and Discussions

    1. Programatically adding an HTTPHandler
      When my custom control is dropped onto a web page at design time, I want an associated HTTPHandler reference to be automatically added to the...
    2. Getting access denied error on using HTTPHandler
      Hi, I am trying to redirect to someother URL when a client request comes to my site by using the HTTPHandler and then taking the response back...
    3. authentication for httphandler
      Hi, I have several httphandlers in a web app. I need to set up a very simple authentication system for users to access these handlers. The...
    4. How do I create a HttpHandler for a WebService(s)?
      Hello: Was excited last month with the options that are opened up by understanding how HttpHandlers work --- works great for my new Image and JS...
    5. What happens if more than one HttpHandler is registered for a file type?
      Okay, I need to create an HttpHandler that will process all requests to the server so that I can perform special logging. What happens if there are...
  3. #2

    Default Re: HttpHandler not working :-)

    sorry, mistake ... I should correct.
    I didn't do my test with simple.aspx. I tested with something like
    path="*.foo" and it didn't worked ...
    althout later on I try simple.aspx and it work ... puzzling ...
    any tip ?

    "Lloyd Dupont" <lloyd@RemoveIfNotSpamming.galador.net> a écrit dans le
    message de news:...
    > I have a simple HttpHandler
    > //--
    > using System.Web;
    > namespace Acme {
    > public class SimpleHandler : IHttpHandler {
    > public void ProcessRequest(HttpContext context) {
    > context.Response.Write("Hello World!");
    > }
    >
    > public bool IsReusable {
    > get {
    > return true;
    > }
    > }
    > }
    > }
    > //--
    > I add in the web config file (perso/Web.config) this simple lines:
    > //--
    > <httpHandlers>
    > <add verb="*"
    > path="simple.aspx"
    > type="perso.FileService, perso"/>
    > </httpHandlers>
    > //--
    >
    > but when I type ' [url]http://localhost/simple.aspx[/url] ' or '
    > [url]http://localhost/perso/simple.aspx[/url] ' I have an error 404.
    > I know that my HttpHandler is registered because if I put incorrect value
    in
    > the config file I get the error page. however I never go into my handler
    (I
    > put some call to Trace.Write() in it, to be sure ...)
    >
    > any tip ? advice ? experience ? whatever ?
    >
    >

    Lloyd Dupont Guest

  4. #3

    Default Re: HttpHandler not working :-)

    You have "simple.aspx" as your Path, but your type is "perso.FileService,
    perso" which indicates that your Page class must be named "FileService" and
    is in the namespace and assembly called "perso". I would guess that your
    ASPX page class is named "simple."

    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of little things.

    "Lloyd Dupont" <lloyd@RemoveIfNotSpamming.galador.net> wrote in message
    news:Ofc07igSDHA.1072@TK2MSFTNGP10.phx.gbl...
    > sorry, mistake ... I should correct.
    > I didn't do my test with simple.aspx. I tested with something like
    > path="*.foo" and it didn't worked ...
    > althout later on I try simple.aspx and it work ... puzzling ...
    > any tip ?
    >
    > "Lloyd Dupont" <lloyd@RemoveIfNotSpamming.galador.net> a écrit dans le
    > message de news:...
    > > I have a simple HttpHandler
    > > //--
    > > using System.Web;
    > > namespace Acme {
    > > public class SimpleHandler : IHttpHandler {
    > > public void ProcessRequest(HttpContext context) {
    > > context.Response.Write("Hello World!");
    > > }
    > >
    > > public bool IsReusable {
    > > get {
    > > return true;
    > > }
    > > }
    > > }
    > > }
    > > //--
    > > I add in the web config file (perso/Web.config) this simple lines:
    > > //--
    > > <httpHandlers>
    > > <add verb="*"
    > > path="simple.aspx"
    > > type="perso.FileService, perso"/>
    > > </httpHandlers>
    > > //--
    > >
    > > but when I type ' [url]http://localhost/simple.aspx[/url] ' or '
    > > [url]http://localhost/perso/simple.aspx[/url] ' I have an error 404.
    > > I know that my HttpHandler is registered because if I put incorrect
    value
    > in
    > > the config file I get the error page. however I never go into my handler
    > (I
    > > put some call to Trace.Write() in it, to be sure ...)
    > >
    > > any tip ? advice ? experience ? whatever ?
    > >
    > >
    >
    >

    Kevin Spencer Guest

  5. #4

    Default Re: HttpHandler not working :-)

    nonono, it was just I didn't tell you the truth (simplifiying and modifying
    y example on the fly) however Bruce answer me accurately nonetheless :-)

    "Kevin Spencer" <kevin@takempis.com> a écrit dans le message de
    news:uEAAlrjSDHA.3144@tk2msftngp13.phx.gbl...
    > You have "simple.aspx" as your Path, but your type is "perso.FileService,
    > perso" which indicates that your Page class must be named "FileService"
    and
    > is in the namespace and assembly called "perso". I would guess that your
    > ASPX page class is named "simple."
    >
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > [url]http://www.takempis.com[/url]
    > Big things are made up of
    > lots of little things.
    >
    > "Lloyd Dupont" <lloyd@RemoveIfNotSpamming.galador.net> wrote in message
    > news:Ofc07igSDHA.1072@TK2MSFTNGP10.phx.gbl...
    > > sorry, mistake ... I should correct.
    > > I didn't do my test with simple.aspx. I tested with something like
    > > path="*.foo" and it didn't worked ...
    > > althout later on I try simple.aspx and it work ... puzzling ...
    > > any tip ?
    > >
    > > "Lloyd Dupont" <lloyd@RemoveIfNotSpamming.galador.net> a écrit dans le
    > > message de news:...
    > > > I have a simple HttpHandler
    > > > //--
    > > > using System.Web;
    > > > namespace Acme {
    > > > public class SimpleHandler : IHttpHandler {
    > > > public void ProcessRequest(HttpContext context) {
    > > > context.Response.Write("Hello World!");
    > > > }
    > > >
    > > > public bool IsReusable {
    > > > get {
    > > > return true;
    > > > }
    > > > }
    > > > }
    > > > }
    > > > //--
    > > > I add in the web config file (perso/Web.config) this simple lines:
    > > > //--
    > > > <httpHandlers>
    > > > <add verb="*"
    > > > path="simple.aspx"
    > > > type="perso.FileService, perso"/>
    > > > </httpHandlers>
    > > > //--
    > > >
    > > > but when I type ' [url]http://localhost/simple.aspx[/url] ' or '
    > > > [url]http://localhost/perso/simple.aspx[/url] ' I have an error 404.
    > > > I know that my HttpHandler is registered because if I put incorrect
    > value
    > > in
    > > > the config file I get the error page. however I never go into my
    handler
    > > (I
    > > > put some call to Trace.Write() in it, to be sure ...)
    > > >
    > > > any tip ? advice ? experience ? whatever ?
    > > >
    > > >
    > >
    > >
    >
    >

    Lloyd Dupont Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139