Well, I guess I've got two cents worth to chip in.
I agree with previous statements that there is no sure fire way to prevent it from happening, but if you use a combination of 3 techniques (maybe 4) you can make it more difficult.
Three techniques I would recomend are:
- javascript: onRightClick(return null) or something along these lines
- use frames where one frame is 0 height. This makes getting to source with view-source much harder
- obfuscate. I saw a script a while back on phpclasses.upperdesign.com that makes your code hard to read. By there's lot's of things that can be done to make your code tricky. White space (lot's of it), Lack of White space (entire web page on a single line), liberal use of html entities, etc...
Of course each of these things has a problem.
- onRightClick is kind of a Windows only, IE only hack. Netscape and other OSs don't honor it. Pressing the funny key next to the windows key on windows machines pops open a menu that does the same thing as the right click feature anyway.
- frames have their own disadvantages.
- obfuscating takes time, and can be undone with htmltidy. I wonder if anyone has written a program called html-untidy? That would be handy.
As a possible 4th option, if you gzip your page, does the view source still work? NN and IE both handle gzip documents transparently.
Hope this helps,
Matt