A
alexvodovoz
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.
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.