Run the html code which entered in textbox
i am having 1 txtbox, where i am entering html code, and display in new page, but it display the code itself, but i need the code to run and display the output in the new page.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satish BhatPosted Sep 16, 2011, 2:58 AM
If you want to change this behaviour, you will need to inherit from Textbox and override the Text property. It currently has the attribute PersistenceMode.EncodedInnerDefaultProperty. I think you have to change it to PersistenceMode.InnerDefaultProperty.
But the simplest way is to use Server.HtmlDecode(). But be careful of Cross-site scripting (XSS) attacks.
Posted Sep 16, 2011, 2:53 AM
chitraPosted Sep 16, 2011, 2:37 AM
Posted Sep 16, 2011, 2:26 AM
window.open('url to open','window name','attribute1,attribute2')