473,326 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to hide the url of an image control

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
Nov 19 '05 #1
9 2231
Using the url(image) attribute of the background property with a CSS class
is about as tricky as it gets noting the stylesheet can always be retrieved
and read.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"J-T" <J-*@nospam.com> wrote in message
news:ep*************@TK2MSFTNGP14.phx.gbl...
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

Nov 19 '05 #2
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-T" <J-*@nospam.com> wrote in message
news:ep*************@TK2MSFTNGP14.phx.gbl...
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

Nov 19 '05 #3
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/

Nov 19 '05 #4
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" wrote:
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/

Nov 19 '05 #5
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." <Bo**@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
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" wrote:
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/

Nov 19 '05 #6
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

Nov 19 '05 #7
Try to view source on this page! Google is able to block end-users from
viewing HTML source code.

Nov 19 '05 #8
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)

Nov 19 '05 #9
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/

Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: deko | last post by:
Is there any way to work around the blank space created by hidden divs? I'm trying to use a relatively postioned divs with show/hide behaviors to annotate an image. The divs show/hide...
5
by: Steve | last post by:
Visual Studio 2003 C# Windows: I have a tree view control as my main menu control down the left side of my application. This has 2 Parent Nodes on it (Jobs and Employees). beneath these 2 main...
0
by: Efkas | last post by:
I have a full custom application with some widged extending Controls like Label and PictureBox. I build a menu with these widgets. When I click on one of them, it calls a function to display...
12
by: Jerad Rose | last post by:
I searched for a while trying to find the answer to this, but to no avail. I am trying to find the best way (or any way) to dynamically show and hide groups of TR's. For example, I have a...
3
by: BB | last post by:
Hi, I am using repeater control.in my aspx page. one of the column of control displays images. Filenames of images are stored in table. Now when I run it and if display Image is blank. I see place...
3
by: | last post by:
I'm using the DataList and GridView controls, and I am trying to wrap my head around the problem of conditionally showing or hiding cells/cell content based on the presence or absence of DB data. I...
12
by: laredotornado | last post by:
Hi, I'm using PHP 5. I was wondering given an image, a.jpg, how can I make an image that would look like you slid a white index card (which I have a file, white.jpg with the same dimensions as...
6
by: Doogie | last post by:
Hi I have an img control I am trying to hide upon certain types of commands in my code behind. When to hide it is directly tied to a asp:dropdownlist control. So depending on what the user...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.