0

I am using ASP.net MVC4 .

I want to hide or not to display any HTML & javascript code similar as in Lightswitch HTML client in Right Click View Source , instead of disabling Right click.

For example if you run any Durundal Application or Light Switch HTML client , Right Click View Source does not show any HTML or JavaScript Code except Layout , I am looking for same behavior

How can I achieve that.

ineffable p
  • 1,207
  • 2
  • 22
  • 46

1 Answers1

1

unlike server-side scripts, you can't hide your html / css / javascript.

the only thing you can is to obfuscate stuff (make your html/css/javascript less readable and more complicated to understand).

client-side code & markup will always be available for the client. on every http request the browser actually downloads the files and reads them locally.

hope that helps.

Community
  • 1
  • 1
geevee
  • 5,411
  • 5
  • 30
  • 48
  • But if you run any Durundal Application or Light Switch HTML client , Right Click View Source does not show any HTML or Javascript Code except Layout , I am looking for same behavioour – ineffable p Oct 22 '13 at 10:34
  • 1
    @ineffablep are you sure I dont see that sources in fiddler? :) – sasjaq Oct 22 '13 at 10:42