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

Stanton_RouxAsked:
Who is Participating?
 
spprivateCommented:
You can  set the Page ValidateRequest="false" and use HttpUtility.HtmlEncode() if you want to supress this message
0
 
spprivateCommented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.