Last post Apr 14, 2009 05:55 AM by infusednz
Sep 12, 2008 03:28 PM|exochris|LINK
I need to intercept all (or non-extension) path requests and process them manually in ASP.Net.
Basically, the pages don't really exist (so there is no Default.aspx) but are being fed from a database (a CMS). I need to be able to feed pages that are requested without a page (/mysite/contact or /contact/) name. How do I do this, and can I do it entirely
in the ASP.Net application or web.config without modifying the server config or the virtual application configuration?
Sep 12, 2008 04:48 PM|shados|LINK
What you'll want to use is the Routing feature of .NET 3.5 SP1, along with a custom IHttpHandler or IHttpHandlerFactory. So basically, you'd have something like *.abc (pick whatever extension you wish) configured in the web.config to point to your http handler,
and then you use the Routing facility to have any address point to your handler.abc (or whatever). So under the hood, it does point to an existing handler, but the URLs will not make that visible because of Routing. And from the handler, then you dispatch
those requests to your "fake" web pages.
And you could even completly bypass the need for an IHttpHandler by simply handling things with an HttpModule, but you need to pick an extension to route to for IIS to handle. The users don't need to know about it.
Sep 12, 2008 09:05 PM|Bruce L|LINK
Setup wildcard mapping on IIS to point to ASP.NET ISAPI.
Apr 14, 2009 05:55 AM|infusednz|LINK
Can you please eloborate on this? I am doing something similar. I need to process all image content via a script. I am basically matching ip addresses to a GeoIP database before returning the image data requested. So it's like a pass through I guess. If
it checks out, pass the request, otherwise redirect to error page.