Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi all,

I am developing a website . I am using JQuery, I am binding dropdown through Jquery Ajax webmethod in all pages. But now,when I right click my page and click view source I see everything i.e. my webmethod name and webservice name. Right now, I am preventing user from right click but if we press f12, we can view the page source.
So How can I encrypt or Hide my view source code?

Please let me know if you have any ideas
Posted
Updated 17-Sep-14 4:41am
v3
Comments
Richard Deeming 17-Sep-14 10:45am    
You can't.
Hemant Singh Rautela 17-Sep-14 10:47am    
You Cant...! :-)

But what is the issue.. your private webservice is cannot accessible to others and webmethod also...

Not really an answer but more so an explanation.

You can do all sorts of tricks to make it hard for someone to view the page source but the bottom line is that because this information is coming across as plain text there is nothing you can do. Anybody determined enough to view the source on your page is going to do it.

Worst case scenario they could just curl your page.

If you have security concerns about them seeing and your webmethods and possibly calling them then your concern should be on properly securing those webmethods.
 
Share this answer
 
If a user can see your page, its source is already on the client side. Too late to try to hide anything.
Face it: if a browser can interpret/render some your resource from the source data, the user can do it, too.

—SA
 
Share this answer
 
you can't do this but one option could be keeping your java script in a .js page and include that page in your page. You can hide your code from view source option
 
Share this answer
 

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