473,657 Members | 2,523 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<location> element in web.config file. Has anyone run into this before?

Hi,

I have been struggling with this for the past couple of days. We have
a custom http module setup in our project to filter some requests. I
only want this module to be applied to certain pages. In order to try
to do this I have added the following test code in our web.config
file.

<location path="Login.asp x">
<system.web>
<httpModules>
<add type="AppTest.W ebUI.RequestFil ter, AppTest"
name="RequestFi lter" />
</httpModules>
</system.web>
</location>

However when I visit the login.aspx page the module doesn't get
executed. Note, that if I change the path to be nothing, for example:.

<location path="">
<system.web>
<httpModules>
<add type="AppTest.W ebUI.RequestFil ter, AppTest"
name="RequestFi lter" />
</httpModules>
</system.web>
</location>

the module executes perfectly however it is applied to every page and
not just the login.aspx page. I have tried pretty much every
combination in the path attribute. Things like "~/login.aspx",
"AppTest/login.aspx", etc. and nothing seems to work. Has anybody
come across this issue before, specifically with trying to apply
access permissions to an httpModule. I've seen a lot of examples with
the authorization element being used, but that is about it. Any help
would be greatly appreciated. I am using asp.net 1.1, IIS 5.1

May 25 '07 #1
2 2347
location filtering is not supported for httpmodules. if you install a
httpmodule, it will be called on all requests (or none if you specify a
path). you will need to add the filtering to your module.

while this is probably a bug, it is now a "known" behavior and will not
fixed in the next release.

-- bruce (sqlwork.com)
al*********@yah oo.com wrote:
Hi,

I have been struggling with this for the past couple of days. We have
a custom http module setup in our project to filter some requests. I
only want this module to be applied to certain pages. In order to try
to do this I have added the following test code in our web.config
file.

<location path="Login.asp x">
<system.web>
<httpModules>
<add type="AppTest.W ebUI.RequestFil ter, AppTest"
name="RequestFi lter" />
</httpModules>
</system.web>
</location>

However when I visit the login.aspx page the module doesn't get
executed. Note, that if I change the path to be nothing, for example:.

<location path="">
<system.web>
<httpModules>
<add type="AppTest.W ebUI.RequestFil ter, AppTest"
name="RequestFi lter" />
</httpModules>
</system.web>
</location>

the module executes perfectly however it is applied to every page and
not just the login.aspx page. I have tried pretty much every
combination in the path attribute. Things like "~/login.aspx",
"AppTest/login.aspx", etc. and nothing seems to work. Has anybody
come across this issue before, specifically with trying to apply
access permissions to an httpModule. I've seen a lot of examples with
the authorization element being used, but that is about it. Any help
would be greatly appreciated. I am using asp.net 1.1, IIS 5.1
May 25 '07 #2
On May 25, 9:35 pm, bruce barker <nos...@nospam. comwrote:
location filtering is not supported for httpmodules. if you install a
httpmodule, it will be called on all requests (or none if you specify a
path). you will need to add the filtering to your module.

while this is probably a bug, it is now a "known" behavior and will not
fixed in the next release.

-- bruce (sqlwork.com)

alexvodo...@yah oo.com wrote:
Hi,
I have been struggling with this for the past couple of days. We have
a custom http module setup in our project to filter some requests. I
only want this module to be applied to certain pages. In order to try
to do this I have added the following test code in our web.config
file.
<location path="Login.asp x">
<system.web>
<httpModules>
<add type="AppTest.W ebUI.RequestFil ter, AppTest"
name="RequestFi lter" />
</httpModules>
</system.web>
</location>
However when I visit the login.aspx page the module doesn't get
executed. Note, that if I change the path to be nothing, for example:.
<location path="">
<system.web>
<httpModules>
<add type="AppTest.W ebUI.RequestFil ter, AppTest"
name="RequestFi lter" />
</httpModules>
</system.web>
</location>
the module executes perfectly however it is applied to every page and
not just the login.aspx page. I have tried pretty much every
combination in the path attribute. Things like "~/login.aspx",
"AppTest/login.aspx", etc. and nothing seems to work. Has anybody
come across this issue before, specifically with trying to apply
access permissions to an httpModule. I've seen a lot of examples with
the authorization element being used, but that is about it. Any help
would be greatly appreciated. I am using asp.net 1.1, IIS 5.1- Hide quoted text -

- Show quoted text -
Agree with Bruce. As a solution you may want to try get the url in the
http module and execute a code if Request.RawUrl will be equal to
"Login.aspx ".

May 25 '07 #3

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

Similar topics

0
1517
by: Joe Abou Jaoude | last post by:
I have an application that support multiple cultures. the main folder is english, and the subfolder "French" is french. I don't want to create a web config in the subfolder french to specify the culture, so I m using the location element in the web.config in the main folder. I have the folowing in web config file: <location path="MyWebApp/French/"> <system.web> <globalization culture="fr-FR" uiCulture="fr-FR" >
1
2577
by: Cantekin Guneser | last post by:
when i used <location> tag as follow; </system.web> <location path="members" allowOverride="false"> <system.web> <authentication mode="Forms"> <forms loginUrl="./default.aspx"></forms> </authentication> <authorization> <deny users="?" /> </authorization>
2
2111
by: joeted | last post by:
Hello, I am trying to run a batch file on a (remote) .NET server (i'm not the admin) using system.diagnostics.process I find that the batch file is successfully executed. However, when i put <identity impersonate="true"/> in my web.config i get an "access denied" exception.
10
3077
by: Brian Henry | last post by:
Hi, I am having a problem with an attachment system I made... it works with files up to ~3MB in size then after that if you try to upload a file it just goes to a "Page can not be displayed" page like it tried to do it but errored... I thought changeing the max size for the file input box to about 100mb would fix it but nope here is my page code and my code behind code... ===============
1
1104
by: Dica | last post by:
i've got a few pages on my site that don't require authentication. is it possible to specify each on of these in the same node within web.config, or do i have to repeat for each? i'd like to do the following if possible: <location path="LoginFailed.aspx", "help.aspx", "faqs.aspx", "sendpassword.aspx"> <system.web> <authorization>
1
2250
by: MAILTONRK | last post by:
Hi, I am a Mainframe guy. I am working with MS access(maintaining a application) for the last 2 weeks. I had one master database and four replicas. One of my replica had trouble in synchronization(It said, database is in use..). After searching google, I ran "Compact and repair" utlity against my replica. It looks like, it has changed the attribute of my replica.
1
1475
by: paris baughman | last post by:
Im trying to setup impersonation in the root directory and turn it off ( false ) in another directory. im doing to allow my crystal reports to work ( as i get the login failed message ) and also ensure that only certain people has access to the maintenance folder ( impersonation = true ). Here is the webconfig : <?xml version="1.0" encoding="utf-8"?> <configuration> <system.web>
1
1263
by: alexvodovoz | last post by:
Hi, I have been struggling with this for the past couple of days. We have a custom http module setup in our project to filter some requests. I only want this module to be applied to certain pages. In order to try to do this I have added the following test code in our web.config file. <location path="Login.aspx"> <system.web>
2
1700
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. I need to deny unauthenticated users from accessing an excel file located within my webapp at SecurePages/ExcelFile1.xls. I've added the below <locationelement to my web.config, but it allows unauthenticated users to access the file. What am I doing wrong? Cannot .xls files be protected this way? <location path="SecurePages/ExcelFile1.xls"> <system.web> <authorization> <deny users="?" />
0
8403
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8316
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
8833
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
7345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6174
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
5636
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
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2735
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
2
1730
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.