views:

39

answers:

1

I've seen a few posts about Application_BeginRequest, but non seems to have my problem.

My Application_BeginRequest is being called for every image in my website.

The StaticFile Handler is enabled with * as the Path, but it's at the end of the list.

Is this the normal behaviour? Or should I add .gif, .jpg and so on on top of the list?

This is on my IIS7.5 Win7 Development Server. Didn't check it on the production server yet.

Update: Setting runAllManagedModulesForAllRequests=false would help. But then the ASP.NET URL Mapping does not work anymore. I tried disable it just for the image directly, but that had no effect?

<location path="Resources">
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="false">
    </modules>
  </system.webServer>
<location>
A: 

make sure this value is false in your web.config.

<modules runAllManagedModulesForAllRequests="false">

if you are running an MVC app I'd suggest looking at this post

Mitch R.
I guess that would help, but then my URL Mapping Code will not work anymore. At least that is what happend.I tried to do that for the images directory, like in the updated Question, but that didn't work either unfortunatly.
Remy