Click here to Skip to main content
15,911,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to hide css file and javascript file from my asp.net page by users
Posted

I don't think you can. For your javascript and css files to be used by your page, you have to allow your users' browsers to download them, therefore you can't hide them in my opinion.
 
Share this answer
 
Comments
Manfred Rudolf Bihy 9-Feb-11 6:20am    
More or less how I see it! 5+
Sergey Alexandrovich Kryukov 9-Feb-11 13:57pm    
True, my 5.
See my explanation... :-)
--SA
Ram, be logical: user's Web browser downloads CSS to do rendering. If it is already on client machine, what possibly could stop the user from having this file?

Are your afraid of the competitor who may steel your nice CSS? The good Web design is made by content (99.999%), regular updates, clarity, clear navigation, convenience. Anyone can steal all of the content but not your good reputation.

—SA
 
Share this answer
 
v3
Comments
Sergey Alexandrovich Kryukov 9-Feb-11 19:53pm    
Manfred, thank you for editing. Probably it's so correct that I did not spot the difference yes... :-)
--SA
Like every one said, why? What is the point? You can't hide them from a determined seeker, but you can, atleast, obfuscate javascript code to some degree. See here [^] and here[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Feb-11 19:03pm    
Yes, yes, my 5.
--SA
What you can do is minify and obfuscate your javascript and also keep it in a separate file. You can't however keep anybody who is determined to see both the javascript and CSS. You cannot protect the javascript and CSS from being seen. All you can do is make it a little harder.

Still unsure? Leave a comment.

Cheers!
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 9-Feb-11 17:52pm    
My 5, I added some rationale in my answer.
Obfuscation, yes, can be done, but can't understand the value of it.
--SA
thatraja 9-Feb-11 20:09pm    
Yeah, 'minify and obfuscate' is the only solution for that. 5!

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