Remove HttpModule for a subfolder

D

Dominik Amon

Hi,

I'm using HttpModules in my ASP.NET Application (Note, i'm not using
HttpHandlers!). Well, it works correctly for the hole application, but i
wan't to remove the httpModule for a special subfolder (a WebService
Folder).

I defined the Module as followed:
<configuration>
....
<system.web>
....
<httpModules>
<add type="WsfRs.Extensions.Client.WebAuthModule, WSF_RS_ConsumerLib"
name="WsfAuthentication"/>
</httpModules>
</system.web>
<configuration>

I thought that there are two ways to solve my problem:

Solution 1 using <location> tags:
<location path="Library/RechenZentrum">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
<httpModules>
<remove name="WsfAuthentication"/>
</httpModules>
</system.web>
</location>

Solution 2, using a second web.config in the subfolder:
<configuration>
<system.web>
<authorization>
<allow users="*"/>
</authorization>
<httpModules>
<remove name="WsfAuthentication"/>
</httpModules>
</system.web>
</configuration>

Well finally, none of them are working (correctly), it looks like that they
are completly ignored by ASP.NET
What i'm doing wrong?

regards,
dominik
 
J

John Timney \(Microsoft MVP\)

Try issuing a clear statement

<httpModules>
<remove name="modulename" />
<clear />
</httpModules>


--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 
D

Dominik Amon

Hi,

I did - i already found the problem, in this third party httpModule i found
the following Codeline:

Application.AuthenticateRequest += new
EventHandler(Application_Authenticate)

That means that the ApplicationAuthenticate always getting invoked, 'cuz of
this statement, even of that <remove> & <clear/> sections. Application is a
global object for all files & subdirectories

regards

--

Mit freundlichen Gruessen,

Dominik Amon
www.amon.cc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top