By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,080 Members | 1,855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,080 IT Pros & Developers. It's quick & easy.

<location> element does not seem to work - Does anybody know how to solve this.

P: n/a
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>
<httpModules>
<add type="AppTest.WebUI.RequestFilter, AppTest"
name="RequestFilter" />
</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.WebUI.RequestFilter, AppTest"
name="RequestFilter" />
</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.

May 25 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
By the way. I am using asp.net 1.1, IIS5.1

May 25 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.