Help: Add/Remove/Clear HttpModule in subfolder never work!

G

Guest

Hi , I thought it's simple ,but end up come here for help(as lots of other
times). --I have several HttpModule added in the root thru web.config, but I
want to remove some and add some new ones in one of sub folder. It is not
fancy virtual folder, but simple sub folder. After create a web.config in the
subfolder,
<system.web>
<httpModules>
<clear />
</httpModules>
</system.web>

and use one of the pages in the subfolder to list
Context.ApplicationInstance.Modules collection, it always give me the full
list that I setup in the root web.config.

I don't know if this is by design in asp.net2 or something I did wrong which
is really hard to find since the scenario is so simple. I guess you may know
the answer.

Thanks a lot if you can put any comment here.
 
B

Brock Allen

<httpModules> are only configured application wide, so only in the app's
root web.config.
 
G

Guest

Hi Brock, so sad to hear this. Originally I tought I could use this powerful
means to handle different site features by separate each into different
folders. I guess I could still do this by developing a
ModuleCollectionMaintenance module and pluginto the BeginRequest event. ( not
sure if this work)

I do have two additional questions: 1. if HttpModule can only setup on the
app root, what's the purpose of clear and remove action, other than the
"virtual folder as separate application" case, I don't think there is any
usage at all! 2.Is there any documentation on this topic ? where do you find
this info.

Thanks a lot for the help and have a nice day.
 
B

Brock Allen

I do have two additional questions: 1. if HttpModule can only setup
on the app root, what's the purpose of clear and remove action, other
than the "virtual folder as separate application" case, I don't think
there is any usage at all!

You can have nested applications and you might want to remove or clear the
ones configured upstream.
2.Is there any documentation on this topic
? where do you find this info.

MSDN documentation, mostly:

http://msdn.microsoft.com/library/

-Brock
http://staff.develop.com/balle
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top