Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

validateRequest="false" is acting weird

(ASP.NET 4.0 C#)

I have my <httpRuntime requestValidationMode="2.0" /> in the webconfig. And I have my validateRequest="false" in page directories.

On one page, I send some data (html) from a ckeditor (textarea) to a database. Works fine. On another page I fill the ckeditor with data from a database, then I update it (send it back), and I get the famous "A potentially dangerous Request.Form value was detected from the client."

Makes me very confused. The only difference is that on the second page the data gets dynamically inserted into the textarea, where on the first page the textarea is empty on pageload. Am i missing something here? Im pretty sure Encoding/decoding doesnt mean anything, as the framework stops it before I can even start messing with it on the backend.

like image 523
Kasper Skov Avatar asked Apr 04 '11 20:04

Kasper Skov


1 Answers

Okay I havent found an answer to why it behaving the way it is. But, I found a very easy and quick way around it (+ new benefits).

Theres a guy who made a .net ckeditor control

http://cksource.com/forums/viewtopic.php?f=11&t=15882

There ya go. Works like a charm. No validation errors what so ever.

like image 119
Kasper Skov Avatar answered Oct 10 '22 04:10

Kasper Skov