Last post Feb 21, 2013 04:52 AM by Jamesdontnet
Feb 21, 2013 04:18 AM|Jamesdontnet|LINK
Hello again ^^,
Back with another newb question :).
Ok so i have a form with a rich text editor attatched to the text area. When the form is submitted I try to put the contents of the form including the textarea with HTML tags into variables. It throws up an error saying potentially dangerous. So how can
i convert the content of the text area from HTML to string so i can stick it into the variable?
I know when re-displaying I can use HTML.Raw(@row.text_area).
Feb 21, 2013 04:35 AM|smirnov|LINK
Use html encoding/decoding
string htmlEncoded = Server.HtmlEncode("<html><head><title>T</title></head></html>");
string original = Server.HtmlDecode(htmlEncoded);
Hope this helps.
Feb 21, 2013 04:46 AM|Jamesdontnet|LINK
Hmm doesnt seem to want to allow me to put html into my text area =/
Feb 21, 2013 04:52 AM|Jamesdontnet|LINK
Managed to find the solution ^^