It is impossible to prevent someone from viewing the source using the browser. When you view the source, what you are seeing is the information that your server has already sent to the web browser. If there were a way to hide that information, your browser would not be able to show you the page that you are looking at. There are some tools out there that can attempt to make reading the source difficult by using javascript and obfuscation. But, if the browser can read it and understand it, then so can anyone.