How to hide the url of an image control

J

J-T

Hi all,

I have an image control on my page for which I set its URL in code-behind
..I'd like the end user not to be able to see this url by right clicking on
th picture and getting its property or digging into the source of he
rendered html. How should I do that?

I appreciate your help in advnce.

Thanks
 
C

Chris Botha

Another setback may be that after someone clicked on the image the target
page should come up and then the address is in the address bar, or if the
page is in a frame, right click on the page and select properties and read
the address.
 
J

jasonkester

You can't. There is simply no way to hide your HTML, Javascript,
images, css, or anything else you send to the client. The client has
to download it all, and it will almost certainly get cached somewhere.
It's part of the price you pay for deploying your application on the
web.

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 
G

Guest

Well, it is possible, but it isn't easy.
It can be done using an http handler. It is possible to build a construction
that checks if the request is generated from your HTML (using
servervariables["referrer"]) .

If you make sure your httphandler handles gif and jpg, all gif's and jpg's
can only be seen from HTML, deeplinking (if the httphandler is constructed
correctly) will show an error, a generic image or anything you want. It is
even possible to write a copyright notice in the image (system.drawing
namespace)...

If you google, you probably will find good coding examples
 
C

clintonG

GONG!

The HTTP_REFERER server variable is as reliable as a rubber crutch in a
polio ward.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/


Bork. said:
Well, it is possible, but it isn't easy.
It can be done using an http handler. It is possible to build a
construction
that checks if the request is generated from your HTML (using
servervariables["referrer"]) .

If you make sure your httphandler handles gif and jpg, all gif's and jpg's
can only be seen from HTML, deeplinking (if the httphandler is constructed
correctly) will show an error, a generic image or anything you want. It is
even possible to write a copyright notice in the image (system.drawing
namespace)...

If you google, you probably will find good coding examples

jasonkester said:
You can't. There is simply no way to hide your HTML, Javascript,
images, css, or anything else you send to the client. The client has
to download it all, and it will almost certainly get cached somewhere.
It's part of the price you pay for deploying your application on the
web.

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 
S

sreejith.ram

If you are trying to stop the user from hotlinking the image or to stop
the user from directly accessing the image later, there are other
methods to do it.

Another option would be to dynamically load the image using a seperate
ASPX page..
In this case your HTML source would look some thing like

<img src="imager.aspx?id=123" />

and you would be able to handle any authentication needed if this page
is accessed directly..

This article may help..
http://www.codeproject.com/aspnet/ASPImaging1.asp
 
S

Sparky Arbuckle

Try to view source on this page! Google is able to block end-users from
viewing HTML source code.
 
S

sreejith.ram

You are probably talking about the View->Source from the top menu which
displays only FRAMESET, FRAME etc.... Right Click on this text and
select View Source from the context menu.. it will display the whole
HTML code for this page. (I am using IE 6)
 
J

jasonkester

No. Google is not able to block end-users from viewing HTML source
code.

They are able to block you from viewing it, which is a start I guess.
But they are still handing it to your browser for display, which means
a skilled individual can fish it out of the cache.

There have been contests for this sort of thing. They invariably end
within minutes.


Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top