0

I've got a virtual path provider (VPP) that serves simple aspx pages. The problem lies when I introduce static references such as *.css, *.jpg files, etc ...

I noticed my VPP is capturing these requests. I don't want this to happen. I want the normal System.Web.StaticFileHandler to handler these requests.

I've added the following in my web config:

    <system.web>
    <httpHandlers>
        <add verb="GET,HEAD" path="*.css" type="System.Web.StaticFileHandler" />
        <add verb="GET,HEAD" path="*.js" type="System.Web.StaticFileHandler" />
        <add verb="GET,HEAD" path="*.jpg" type="System.Web.StaticFileHandler" />
        <add verb="GET,HEAD" path="*.gif" type="System.Web.StaticFileHandler" />
    </httpHandlers>
</system.web>

But my VPP still handles these requests. Any ideas?

cheers in advance

downatone
  • 1,936
  • 2
  • 23
  • 30

1 Answers1

0

I guess the VirtualPathProvider is invoked for every request. You'll have to override the FileExists method to tell the runtime whether the request is handled by the VirtualPathProvider or not.

M4N
  • 94,805
  • 45
  • 217
  • 260
  • Already doing that - slimmed down version: public override bool FileExists(string virtualPath) { if (virtualPath.EndsWith(".aspx")) return true; else return false; } – downatone Sep 21 '09 at 19:41