Could some one please help me out to hide a view source option of a web page in dot net ?
You can't, it is an option of the browser. The best you can do is obfuscate it.
Back in the Geocities era of the internet it wasn't uncommon for sites to use javascript to capture right clicks and popup a message box saying that you weren't allowed to view the source (or save an image or something).
This isn't quite so common nowadays for three main reasons:
That said, there are ways of obfuscating the code such that the browser can still parse it, but that it is at least annoying for a human to do so. You can use javascript to write certain parts of the page (a la AJAX) such that viewing the vanilla source code doesn't show what it actually rendered. Or you can compress it removing all formatting and naming elements (once it goes to production) such that it is at the very least annoying to follow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With