Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / May 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
alexvodovoz@yahoo.com - 25 May 2007 20:15 GMT
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 am using asp.net 1.1, IIS 5.1
bruce barker - 25 May 2007 20:35 GMT
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)

> Hi,
>
[quoted text clipped - 33 lines]
> 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
Alexey Smirnov - 25 May 2007 21:53 GMT
> 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
[quoted text clipped - 45 lines]
>
> - 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".

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.