Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
website created in asp.net c# webforms. after running website on browser when we right click on page then there is one option that view source. by which any one can able to see a code. is it quite risky! how to avoid user from able to do this ?

What I have tried:

website created in asp.net c# webforms
Posted
Updated 12-Jan-17 21:46pm

1 solution

You can't stop the user form doing this, there are lots of ways to get the html besides view->source.
 
Share this answer
 
Comments
Kishor-KW 18-May-16 13:55pm    
means we can't do anything to avoid this encryption or else? if there is select query then my table name name column are visible to attacker.
F-ES Sitecore 18-May-16 13:58pm    
Don't put select queries in your html then. Just bear in mind everything in the html is visible.
Kishor-KW 18-May-16 13:58pm    
and code in .cs file. is not visible r8?
Dave Kreskowiak 18-May-16 14:26pm    
No, because ASP.NET code (C#) runs entirely on the server, never the client. ASP.NET code just generates HTML pages and sends that to the client, complete with any CSS files, other content, client-side script files (javascript), ...

THe only "source" the browser gets to see are the files that are sent to the browser in order to render and interact with the page, HTML, CSS, javascript, ... NEVER the *.cs files.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900