Assume there is a form to submit text and will be showed later. It will allow users to key in codes or java or any scripts. But the Question is: How to only show their in html/text form and do not they run in server? Any simple way? Thanks,
I am not sure I understand the question... are you saying that people can post scripts, html, asp, php, etc code in a text box only to be displayed on a page later - but not run? Just like you can include code here and wrap it in a tag? Simplest way store the posting in a variable then have ASP replace all < with < and > with > This way, the symbols will still appear on the web page, but scripts won't run. Code (markup):
I am not entirely sure what you mean... but maybe this will help. try surrounding the text in <pre> ... </pre> tags. This makes the browser not render the text. i.e. lblShow.text = "<pre>" & txtText.text & "</pre>"
Specifically for ASP code, you do not have to worry as this runs before any dunamic content is added. So if you disaply asp code from a variable or a databse it would not execute.. It would be treated as standard text.. javascript, html etc. though which are interpreted by the browser will be executed unless you encode them for html as nyxano suggested.