Disable View Source Button?

J

Joe

Hi,

I have a customer who wants the View Source button disabled when
people view his website. I explained to him how in ASP.NET the "real"
code is in the code-behind module and not visible to the end-user
anyway, but he really wants that View Source button disabled.

Can anyone tell me how to do this?


JD
 
S

Scott M.

You can't. Pardon me, but your customer sounds like they arejust being
ignorant of the nature of the web's architecture. HTML, JavaScript, CSS and
any other client-side code are not protectable by copyright laws. Anyone
can look at this code (and reuse it if they wish).
 
M

Mark Rae [MVP]

I have a customer who wants the View Source button disabled when
people view his website. I explained to him how in ASP.NET the "real"
code is in the code-behind module and not visible to the end-user
anyway, but he really wants that View Source button disabled.

There is no 100% reliable way to do this. In order for a browser to display
a web page, the markup for that web page has to be streamed down to the
browser.

What are your customer's reasons for wanting to do this...?
 
N

nahid

Hi,

I have a customer who wants the View Source button disabled when
people view his website. I explained to him how in ASP.NET the "real"
code is in the code-behind module and not visible to the end-user
anyway, but he really wants that View Source button disabled.

Can anyone tell me how to do this?

JD

hi,
i know how to disable right mouse click in ie using
<body oncontextmenu="return false">
and if you open window using
window.open("untitled.html",'TheNewpop',
'fullscreen=yes,toolbar=no,location=no,directories=no,
status=no,menubar=no,scrollbars=no,resizable=no')

no menu and tool will be there...your client may be happy a
bit .....by the time being try to convenes him

nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd
 
M

Mark Rae [MVP]

i know how to disable right mouse click in ie using
<body oncontextmenu="return false">

This will only prevent keep real novices out, and they're the people who
would be least in a position to do anything with it anyway. For everyone
else, it's just an irriation, and easy enough to bypass. Just hold the right
mouse button down, let it display the alert, keep the right mouse button
held and press Enter on the keyboard to close the alert, then let the mouse
button go. The mouseup event fires and displays the the context menu.

Most advanced users don't view pages' source anyway unless they have a good
reason to. However, trying to keep them out will definitely make them
curious i.e. they will think you have something to hide, so you're only
making matters worse!
and if you open window using
window.open("untitled.html",'TheNewpop',
'fullscreen=yes,toolbar=no,location=no,directories=no,
status=no,menubar=no,scrollbars=no,resizable=no')
no menu and tool will be there...

Until you hit F11...

Complete waste of time.
 
G

Guest

Even if you were to successfully disable the right-click mouse event, the
page contents are going into the browser's cache anyway where anybody with an
above room-temperature IQ can view them at their pleasure.

The best approach here would simply be to patiently explain to your client
that what they want is basically, a "lost cause".
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com
 
M

Mark Rae [MVP]

The best approach here would simply be to patiently explain to your client
that what they want is basically, a "lost cause".

Absolutely correct which, as any experienced IT consultant knows only too
well, is more often than not the hardest job of all... :)
 
N

nahid

no menu and tool will be there...no menu and tool will be there...your client may be happy a
bit .....by the time being try to convenes him


guys i know all... please you read last line carefully i just tell him
how maximum he can do....
your client may be happy a bit .....by the time being try to convenes him

the client is crazy and temporary stop him crazily...then i said
(convenes him) ....

thnaks
all
 
S

Scott M.

Or, clear the temporary Internet files, go to the web page, then check the
temporary Internet files for the downloaded cached file and open it with
Notepad.
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top