Link to home
Start Free TrialLog in
Avatar of Stanton_Roux
Stanton_RouxFlag for South Africa

asked on

How do I submit HTML from a text box

Hi There
I have a multiline textbox that I am want to use to save html in the db that will be diplayed later as a divs innerhtml.

When I submit my for I get a ASP.Net error saying that potetially usafe content has been submitted.

How do I save html as not to get this message.

// Insert code
 
   SkinMan.Code =txtCode.Text;//failing here
   m_contentManager.SaveSkins(SkinMan);
 
//display code
 dvLinks.InnerHtml = skinman.Code;

Open in new window

Avatar of spprivate
spprivate
Flag of United States of America image

This is a security feature to prevent cross site script attack

http://tldp.org/HOWTO/Secure-Programs-HOWTO/cross-site-malicious-content.html
You need to use htmlencoding in asp.net to prevent this message
ASKER CERTIFIED SOLUTION
Avatar of spprivate
spprivate
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial