Ask a Question related to ASP.NET General, Design and Development.
-
Lloyd Dupont #1
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
-
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... -
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... -
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... -
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... -
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... -
Lloyd Dupont #2
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:...in> 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(I> the config file I get the error page. however I never go into my handler> put some call to Trace.Write() in it, to be sure ...)
>
> any tip ? advice ? experience ? whatever ?
>
>
Lloyd Dupont Guest
-
Kevin Spencer #3
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...value> 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> in> (I> > the config file I get the error page. however I never go into my handler>> > put some call to Trace.Write() in it, to be sure ...)
> >
> > any tip ? advice ? experience ? whatever ?
> >
> >
>
Kevin Spencer Guest
-
Lloyd Dupont #4
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...and> You have "simple.aspx" as your Path, but your type is "perso.FileService,
> perso" which indicates that your Page class must be named "FileService"handler> 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...> value> > 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> > in> > > the config file I get the error page. however I never go into my>> > (I> >> > > put some call to Trace.Write() in it, to be sure ...)
> > >
> > > any tip ? advice ? experience ? whatever ?
> > >
> > >
> >
>
Lloyd Dupont Guest



Reply With Quote

