views:

112

answers:

2

I have many static images under a directory in my site structure, and I'm not concerned with hotlinking or copy-protecting the images. For a myriad of reasons, what I need to do is not show the image path on the site (or show a fake one).

Is there any way to do this without resorting to an http handler or a worker asp.net page?

A: 

You could use a generic ASHX handler for this.

Dan Diplo
The question says "without resorting to an http handler".
LukeH
That's true! But I was wondering if there was a simpler, more straight way of doing this.
jehuty
@Luke - I read it as not resorting to a custom HTTP handler.
Dan Diplo
+1  A: 

You could use URL Rewritting. Doing it yourself would require you to implement a custom handler but there are third party options already available you could try.

I would guess however that a simple http handler implemented as an ASHX endpoint would probably be the easiest option.

JoshBerke
Another option would be URL routing (but only if .NET4 can be used): http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx
LukeH
@Josh and @Luke: Not exactly what I wanted right now, but very good references that will definitely come in handy. Thanks a lot!
jehuty
@Campos, I figured but that's the best I can come up with:-) Good luck if you find a simpler method let us know please
JoshBerke