Re: httpHandlers



Your custom HttpHandler should use a different file extension than "aspx."
It is the extension that identifies the handler to the web server.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Manso" <Manso@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D3351C8D-F38E-4D8C-A38E-030B039B908D@xxxxxxxxxxxxxxxx
Hi John,

Thanks for your prompt reply.

We are only rewriting URLs with aspx extensions e.g.

www.site.com/products/category1/My-item1.aspx

will be rewritten as

www.site.com/products.aspx?item=My-item1&cat=category1

This means we have to react to all aspx-request. We check to see if the
file
physically exists and skipped it if it did so existing pages (such as
product.aspx in the example above) would execute as normal.

Problem with HttpHandler is that they don't exist in the file system and
in
our application we won't be able to tell whether it's a httpHandler or a
"normal" request that needs to be rewritten. We somehow need to be able to
identfy this as a call to a handler. Third party apps can register
themselves
as handlers ("getfile.aspx", "makereservation.aspx" etc).

Thanks,
- Manso

"John Timney (MVP)" wrote:

Might be one of those odd suggestions - but have you tried to just check
the
request extension and drop through your handler if its missing or has an
..aspx extension?

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog


"Manso" <Manso@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4D0B235D-78B2-4CD7-9B2D-A752081A57EB@xxxxxxxxxxxxxxxx
Hi,

We are doing custom request rewriting in a httpModule in
Application.AuthenticateRequest for requests coming in with .aspx using
HttpContext.RewritePath().

We are having a problem identifying requests that come in from
registered
httpHandlers i.e. handlers with extension .aspx. These should just fall
through and not be analyzed/rewritten. Is there a way (flag?) that
identifies
a request as a request to a handler? The Context.CurrentHandler is not
yet
set this early.

We could always read the configuration data but since handlers can be
added
further down in the config hierarchy we cannot cache it and it seems
like
a
costly operation.

Grateful for any ideas.

Thanks,
Manso





.



Relevant Pages

  • Re: httpHandlers
    ... It is the extension that identifies the handler to the web server. ... We are only rewriting URLs with aspx extensions e.g. ... "normal" request that needs to be rewritten. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Using an HttpHandler to redirect a certain extension to ASPX pages behind the scenes
    ... Why don't you just assign ASP.Net as the handler for this extension? ... ASP.Net will handle the request, ... I'd like to basically figure out which ASPX page to ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: httpHandlers
    ... ..aspx extension exclusively with your HttpHandler. ... It is the extension that identifies the handler to the web server. ... "normal" request that needs to be rewritten. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Using an HttpHandler to redirect a certain extension to ASPX pages behind the scenes
    ... You would have to add an ISAPI mapping in IIS, ... Request transferred to an ASP.Net Page without the problem you're describing ... that extension with the same DLL that ASPX is associated with in the IIS ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: httpHandlers
    ... ..aspx extension? ... We are doing custom request rewriting in a httpModule in ... Application.AuthenticateRequest for requests coming in with .aspx using ... a request as a request to a handler? ...
    (microsoft.public.dotnet.framework.aspnet)