TinyMCE Editor: A potentially dangerous Request.Form value was detected at the client

I have aspx in that I invoke the ascx user element in that I use the tinymce editor. When I try to save data, I get an error.

A potentially dangerous Request.Form value was detected from the client (UserControl1 $ TextBox1 = "

fgh

fghj

I already checked the potentially dangerous value of Request.Form was detected at the client

I tried:

web.config I installed

<pages validateRequest="false"> <httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters=""/> <compilation debug="true" targetFramework="4.0"> <@page validateRequest="false"> Server.HtmlEncode(TextBox1.Text) encoding: "xml" // This is solving the prob. but Text is converting in HTML tag I don't want that 

Please help me...

+7
source share
3 answers

Add this to httpRuntime

 < httpRuntime requestValidationMode="2.0" /> 
+3
source

You can also try adding an encoding attribute: encoding: 'xml'

 <script> tinymce.init({ selector: 'textarea', encoding: 'xml' }); </script> 

You can check this link, it reads:

encoding: "xml"

- solves "A potentially dangerous Request.Form value was found" that will not allow you to submit a web form

+1
source

Any reason why you cannot encode a string and store it in your database, and then before displaying the encoded string, can you simply decode it?

0
source

All Articles