473,770 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems removing an HttpModule for a sub directory.

Hello,

In my top-level Web.config, I had added a number of httpModules.
In a particular sub-directory in the application, I wish to prevent one of
the HttpModules from executing. My attempts using the <remove> element to
remove the HttpModule for a subdir have not worked.

----
My top-level Web.config contains [just the parts of interest]:

<configuratio n>

<system.web>
<!-- By default, everone gets the module. This part works fine. -->
<httpModules>
<add name="MyModule" type="HighBeam. MyModule, HighBeamLib"/>
<httpModules>
</system.web>

<!-- I don't want to execute MyModule for any /test files.
This part doesn't work though. -->
<location path="test">
<system.web>
<httpModules>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

</configuration>
---

As an experiment, I put in a bogus <blah> element within the httpModules
element like so:

<location path="test">
<system.web>
<httpModules>
<blah/>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

but this does not cause an error as I would expect. So it seems as though
the contents of the <httpModules> element is not being processed.

---

I see the same results when I remove the <location> element from the
top-level Web.config, and add a Web.config in the test sub-dir, and have the
sub-dir config remove the httpModule.

I'm using .Net Framework 1.1 (Version 1.1.4322 SP1) on Windows Server 2003.
I'm not sure if any other info would be of interest.
Any help would be greatly appreciated.

Thank you,
- Chip Page
Nov 19 '05 #1
4 1612
Chip,
Have you tried include the type in the <remove> tag:

Example:

<location path="test">
<system.web>
<httpModules>
<remove name="MyModule" type="HighBeam. MyModule.HighBe amLib" />
</httpModules>
</system.web>

Let me know how that works

Steve

"Chip Page" <Ch******@discu ssions.microsof t.com> wrote in message
news:CF******** *************** ***********@mic rosoft.com...
Hello,

In my top-level Web.config, I had added a number of httpModules.
In a particular sub-directory in the application, I wish to prevent one of
the HttpModules from executing. My attempts using the <remove> element to
remove the HttpModule for a subdir have not worked.

----
My top-level Web.config contains [just the parts of interest]:

<configuratio n>

<system.web>
<!-- By default, everone gets the module. This part works fine. -->
<httpModules>
<add name="MyModule" type="HighBeam. MyModule, HighBeamLib"/>
<httpModules>
</system.web>

<!-- I don't want to execute MyModule for any /test files.
This part doesn't work though. -->
<location path="test">
<system.web>
<httpModules>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

</configuration>
---

As an experiment, I put in a bogus <blah> element within the httpModules
element like so:

<location path="test">
<system.web>
<httpModules>
<blah/>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

but this does not cause an error as I would expect. So it seems as though
the contents of the <httpModules> element is not being processed.

---

I see the same results when I remove the <location> element from the
top-level Web.config, and add a Web.config in the test sub-dir, and have the sub-dir config remove the httpModule.

I'm using .Net Framework 1.1 (Version 1.1.4322 SP1) on Windows Server 2003. I'm not sure if any other info would be of interest.
Any help would be greatly appreciated.

Thank you,
- Chip Page

Nov 19 '05 #2
Hi everyone, I am also having the same problem.

Does the sub directory have to be an application/vroot in its own right to
add/ remove httpmodules ?

If it does it will cause me all manner of problems....

"Chip Page" wrote:
Hello,

In my top-level Web.config, I had added a number of httpModules.
In a particular sub-directory in the application, I wish to prevent one of
the HttpModules from executing. My attempts using the <remove> element to
remove the HttpModule for a subdir have not worked.

----
My top-level Web.config contains [just the parts of interest]:

<configuratio n>

<system.web>
<!-- By default, everone gets the module. This part works fine. -->
<httpModules>
<add name="MyModule" type="HighBeam. MyModule, HighBeamLib"/>
<httpModules>
</system.web>

<!-- I don't want to execute MyModule for any /test files.
This part doesn't work though. -->
<location path="test">
<system.web>
<httpModules>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

</configuration>
---

As an experiment, I put in a bogus <blah> element within the httpModules
element like so:

<location path="test">
<system.web>
<httpModules>
<blah/>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

but this does not cause an error as I would expect. So it seems as though
the contents of the <httpModules> element is not being processed.

---

I see the same results when I remove the <location> element from the
top-level Web.config, and add a Web.config in the test sub-dir, and have the
sub-dir config remove the httpModule.

I'm using .Net Framework 1.1 (Version 1.1.4322 SP1) on Windows Server 2003.
I'm not sure if any other info would be of interest.
Any help would be greatly appreciated.

Thank you,
- Chip Page

Nov 19 '05 #3
HttpModules are loaded and called at the vdir level (asp.net application).
To have a subdir have its own, you will to make it its own application.

you could add the filtering to to your module to support subdirs.

-- bruce (sqlwork.com)
"london calling" <lo***********@ discussions.mic rosoft.com> wrote in message
news:F8******** *************** ***********@mic rosoft.com...
Hi everyone, I am also having the same problem.

Does the sub directory have to be an application/vroot in its own right to
add/ remove httpmodules ?

If it does it will cause me all manner of problems....

"Chip Page" wrote:
Hello,

In my top-level Web.config, I had added a number of httpModules.
In a particular sub-directory in the application, I wish to prevent one
of
the HttpModules from executing. My attempts using the <remove> element
to
remove the HttpModule for a subdir have not worked.

----
My top-level Web.config contains [just the parts of interest]:

<configuratio n>

<system.web>
<!-- By default, everone gets the module. This part works fine. -->
<httpModules>
<add name="MyModule" type="HighBeam. MyModule, HighBeamLib"/>
<httpModules>
</system.web>

<!-- I don't want to execute MyModule for any /test files.
This part doesn't work though. -->
<location path="test">
<system.web>
<httpModules>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

</configuration>
---

As an experiment, I put in a bogus <blah> element within the httpModules
element like so:

<location path="test">
<system.web>
<httpModules>
<blah/>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

but this does not cause an error as I would expect. So it seems as
though
the contents of the <httpModules> element is not being processed.

---

I see the same results when I remove the <location> element from the
top-level Web.config, and add a Web.config in the test sub-dir, and have
the
sub-dir config remove the httpModule.

I'm using .Net Framework 1.1 (Version 1.1.4322 SP1) on Windows Server
2003.
I'm not sure if any other info would be of interest.
Any help would be greatly appreciated.

Thank you,
- Chip Page

Nov 19 '05 #4
Hi Bruce, thanks for clarifying that. I have filtered in a 'brokering' module
and it works successfully , though it makes for a less pluggable architecture.

Thanks again

jd

"Bruce Barker" wrote:
HttpModules are loaded and called at the vdir level (asp.net application).
To have a subdir have its own, you will to make it its own application.

you could add the filtering to to your module to support subdirs.

-- bruce (sqlwork.com)
"london calling" <lo***********@ discussions.mic rosoft.com> wrote in message
news:F8******** *************** ***********@mic rosoft.com...
Hi everyone, I am also having the same problem.

Does the sub directory have to be an application/vroot in its own right to
add/ remove httpmodules ?

If it does it will cause me all manner of problems....

"Chip Page" wrote:
Hello,

In my top-level Web.config, I had added a number of httpModules.
In a particular sub-directory in the application, I wish to prevent one
of
the HttpModules from executing. My attempts using the <remove> element
to
remove the HttpModule for a subdir have not worked.

----
My top-level Web.config contains [just the parts of interest]:

<configuratio n>

<system.web>
<!-- By default, everone gets the module. This part works fine. -->
<httpModules>
<add name="MyModule" type="HighBeam. MyModule, HighBeamLib"/>
<httpModules>
</system.web>

<!-- I don't want to execute MyModule for any /test files.
This part doesn't work though. -->
<location path="test">
<system.web>
<httpModules>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

</configuration>
---

As an experiment, I put in a bogus <blah> element within the httpModules
element like so:

<location path="test">
<system.web>
<httpModules>
<blah/>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

but this does not cause an error as I would expect. So it seems as
though
the contents of the <httpModules> element is not being processed.

---

I see the same results when I remove the <location> element from the
top-level Web.config, and add a Web.config in the test sub-dir, and have
the
sub-dir config remove the httpModule.

I'm using .Net Framework 1.1 (Version 1.1.4322 SP1) on Windows Server
2003.
I'm not sure if any other info would be of interest.
Any help would be greatly appreciated.

Thank you,
- Chip Page


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1559
by: Bruce B | last post by:
Hi group, I'm experiencing some extreme weirdness over the last week with IIS related to it's Mappings and how .NET is behaving. I can't explain the behavior as it seems very random. Our app has about 50 file extensions that we map in IIS and handle in our HTTPHandler to catch the reference and then lookup the correct content from a database. In addition, we do some magic in a HTTPModule to rewrite paths for file types we don't...
1
1656
by: Ryan Cromwell | last post by:
I have written an httpModule for use in our test environment. If a user goes to http://testserver/SomeApplication/MyPage.aspx it will resolve to the latest version of that application deployed: http://testserver/SomeApplication.1.0.10.0/MyPage.aspx, for instance. Problem is, the httpModule doesn't get called because http://testserver/SomeApplication doesn't exist. I assume this is because IIS is spitting it back, but I am not sure. ...
4
6203
by: | last post by:
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
2
1557
by: Michael Appelmans | last post by:
I have implemented an httpmodule class and added it in the web.config, but when I try and use Context.RewritePath I get error: The virtual path "/searchresult?categoryid=104" maps to another application which is not allowed. How to I make my httpmodule part and parcel of the storefront shopping cart application I am using? What determines, in a given directory, who the application is?
0
1123
by: Ian Suttle | last post by:
I have created an HTTPModule for error handling, which I only want to handle a specified directory structure. In the root of my application, I have altered the web.config file as follows: <configuration> <location path="dir/dir/dirToHandle"> <system.web> <httpModules> <add name="ErrorHandler" type="ErrorModule.ErrorHandler, ErrorModule" /> </httpModules>
1
1903
by: Faraz | last post by:
Hi everyone, I am running into a slight problem. My understanding is that a custom HttpModule will run for every request made to the server, regardless of the extension. I do not experience this behavior. My module only runs for the extensions handled by the aspnet_isapi.dll. Here are my sequence of steps: 1) Create the HttpModule 2) Compile and drop dll in the webApp bin directory.
1
1618
by: Max | last post by:
I have my HTTPModule or HTTPHandler registered to process all file types (*). I have IIS configured to pass all requests to ASP.NET for this virtual directory. In some cases depending on the request parameters I may decide that I need to yield this request and I want it to be processed as if my handler was not installed there and is if ASP.NET was configured to process only *.aspx files. Is there a relatively simple way to implement...
3
2185
by: Jose Fernandez | last post by:
HI first of all, excuse me for my english. And Thank in advance for even read my post. I have a problem that is driving me insane. I have an application (JUCAR) which use HttpModule and i have declared of course into the Webconfig. This application runs perfect. So, i created another application (Accreditation), that runs perfect too inside of it as a virtual directory that does not use HttpModule. Now i am getting this error....
4
2082
by: Bac2Day1 | last post by:
I've got a HTTPMODULE that I need to be included on some pages within my site, but not others. This will allow security (the purpose of the module) on most parts of my site, but I need to bypass loading the httpmodule on web services within my site. I do not have direct access to manipulate the module, so I need to figure out a way to either enable/add the module on only certain pages, or a way to disable a module on certain pages. Any...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10231
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10059
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6679
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.