ISAPI and HTTPModules
What you are asking for is currently not doable with ASP.Net. .Net is not
controlling the HTTP Pipeline of IIS.
The feature you're talking about is to use ASP.Net to filter incoming
requests using a .Net HTTP Module by scriptmapping ASP.Net to handle
particular extensions.
Prior to IIS6, the underlying mechanism for a handler to tell IIS to
"re-execute" the URL is not available, so this is not possible on those IIS
versions.
IIS6 exposes a native mechanism to allow a handler to tell IIS to
"re-execute" any URL (with some caveats). A feature called "wildcard
application mapping" can take advantage of this mechanism to filter incoming
requests using a ISAPI Extension DLL (cannot be a .Net DLL, including
managed C++ [due to a CLR bug]). However, ASP.Net does not take advantage of
this, so .Net HTTP Modules can't do this.
If we're talking about prior to IIS6, your solution needs an ISAPI Filter.
If we're talking about IIS6, then your solution can be mostly implemented in
an ISAPI Extension configured as a wildcard application mapping.
--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
I have an interesting problem and am looking for some insight. I have been
working on a c# HTTPModule that "assists" forms authentication, with the
specific goal of handling authentication for Windows SharePoint services.
Most of the problems are fairly routine and easy to solve, however there is
one that has completely got me stumped. Several of the SharePoint functions
post data directly back to ISAPI extensions. In order to get IIS to run the
HTTPModule for the request being sent to the ISAPI extension, I have to map
the .DLL extension to the asp.net ISAPI extension. When this mapping is in
place, the HTTPModule runs fine, but IIS does not appear to pass the right
reference to the original ISAPI extension. I have a workaround, where all
calls to the DLL are actually passed through a server request proxy that
calls the original extension in another virtual directory; however the
overhead is obviously huge. I am thinking that I should be able to call the
original ISAPI DLL directly, but I cannot figure out how (using c# inside a
running request) to capture or create the correct control block (ECB), nor
how to pass in the correct references for the call back routines to access
the request and response. I understand that this work is more suited to an
ISAPI filter, and have already got that working, but the solution seems more
elegant if it is ".NET".
Thanks
Robert Ginsburg (robert.ginsburg@ver3.com)
|