3

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?

jehuty
  • 528
  • 1
  • 6
  • 20

2 Answers2

1

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
  • 66,142
  • 25
  • 126
  • 164
  • 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 Apr 20 '10 at 14:57
  • @Josh and @Luke: Not exactly what I wanted right now, but very good references that will definitely come in handy. Thanks a lot! – jehuty Apr 20 '10 at 15:01
  • @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 Apr 20 '10 at 18:05
0

You could use a generic ASHX handler for this.

Dan Diplo
  • 25,076
  • 4
  • 67
  • 89