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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • walter

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

    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.Applica tionInstance.Mo dules 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.
  • Brock Allen

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

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

    -Brock


    [color=blue]
    > 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.Applica tionInstance.Mo dules 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.
    >[/color]


    Comment

    • walter

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

      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
      ModuleCollectio nMaintenance 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.



      "Brock Allen" wrote:
      [color=blue]
      > <httpModules> are only configured application wide, so only in the app's
      > root web.config.
      >
      > -Brock
      > http://staff.develop.com/ballen
      >
      >[color=green]
      > > 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.Applica tionInstance.Mo dules 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.
      > >[/color]
      >
      >
      >[/color]

      Comment

      • Brock Allen

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

        > I do have two additional questions: 1. if HttpModule can only setup[color=blue]
        > 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![/color]

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

        MSDN documentation, mostly:



        -Brock



        Comment

        Working...