Re: HTTPModule not called for non-existant pages

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

inge_at_norway.net
Date: 11/26/04


Date: Fri, 26 Nov 2004 10:35:35 +0100

Thank you for the reply.

If my memory is not failling me, I have had the handler be called for
nonexistant files, and also for folder names - without changing the default
document.

But what you say seems to be working - at least insofar as the HttpModule
being triggered when the request is for any kind of .aspx.

However, I have moved the default.aspx-file to the top of the
default-documents list (which *is* enabled). the handler is still not
executed if I only request http://myserver/mywebsite

If I put in a file of that name, it works (as expected) - but this requires
a default.aspx in every subfolder, in order to get the httpmodule to process
BeginRequest.

This is *not* the behaviour I experienced this spring :/

So I am still wondering that something might have changed e.g. with the
introduction of WinXP sp2

-Inge

"Jeffrey Palermo [MCP]" <http://dotnetjunkies.com/weblog/jpalermo> wrote in
message news:euWDoT30EHA.1740@TK2MSFTNGP15.phx.gbl...
> Inge,
> To do some work based on the requested page whether or not it exists,
> do
> the work using the AuthorizeRequest event. I use this event to do URL
> rewriting. Of course, there are still some restrictions. If you have the
> default page set to default.aspx, and there is no default.aspx, then the
> ASP.NET ISAPI won't ever be called from IIS. If you have a default page,
> IIS handles translating a request to /subFolder/ into
> /subFolder/default.aspx. Then the requested resource ends in .aspx and
> the
> ASP.NET ISAPI takes over and will execute you code, so a situation may
> still
> exist where IIS never calls ASP.NET.
>
> Best regards,
> Jeffrey Palermo
>
> <inge@norway.net> wrote in message
> news:ep87Eb00EHA.3364@TK2MSFTNGP12.phx.gbl...
>> I have earlier used an HttpModule that did URL rewrites on the
> BeginRequest
>> event.
>>
>> Now I am trying to use the same module in a different application on a
>> new
>> and upgraded machine (winxp sp2).
>>
>> The Module is registered via Web.config. The registration is OK. When
> asking
>> for an existing .aspx page, the eventhandler is called as it should.
>>
>> HOWEVER - if the request url is for a non-existant file, I get a 404 -
> file
>> not found error. The module is never called.
>> And if the url is only a path name e.g. http://server/some/path - and
>> that
>> path does not allow browsing, then I get Directory Listing Denied error.
> If
>> browsing is allowed, I see the contents. The HttpModule BeginRequest
> method
>> is *not* called in these instances.
>>
>> Any clues on what I may be missing here? or is this a change done through
>> sp2?
>>
>> Thank you for your time!
>>
>> -Inge
>>
>>
>
>



Relevant Pages

  • RE: Mobile Caching Problems
    ... of each page(or handler) request globally. ... article that help explain the role & events of httpmodule in ASP.NET ... you can create a custom httpmodule and hook one of the ...
    (microsoft.public.dotnet.framework.aspnet.mobile)
  • Re: Modular PHP
    ... How can I catch an event in PHP. ... Everything is done with XML, so you will want to be familiar with XSLT ... the function itentified by the Handler attribute in the above XML, ... It's also worth noting that all the XML parsing for the request map ...
    (comp.lang.php)
  • Re: ISAPI vs. HTTPModule
    ... which parses the request and dispatches it to IIS in usermode. ... extension of the request is determined, and then sent to its handler. ... > ISAPI will not be able to access any .Net intrinsics/events. ...
    (microsoft.public.inetserver.iis)
  • Re: Custom HttpHandler and Server.Transfer
    ... server side processing path for the current request. ... | Subject: Re: Custom HttpHandler and Server.Transfer ... |>methods only addressing transfer to another Page handler, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Async callbacks with Global.asax
    ... ICallbackEventHandler and RaiseCallbackEvent) and a regular GET request ... And here is the page that handles the callback request. ... the callback handler in _Default page. ... includeStagesBeforeAsyncPoint = true, bool includeStagesAfterAsyncPoint ...
    (microsoft.public.dotnet.framework.aspnet)