I have an MVC3 C# .Net web app. We are using CKEditor. We are saving our CKEditor HTML to fields in our DB. We are escaping the HTML when inserting. i.e.
<strong> Effort estimated for the subtask elements</strong>
becomes
<strong> Effort estimated for the subtask elements </strong>
This is working fine. However, when Re-Posting the View on a Drop Down onchange event after loading the View, I am getting the following error.
System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (TextBoeSbTkDescription="<p>
<strong>Exampl...").
The values in the text boxes are converted from escaped HTML to unescaped when loading the page. I put a break point in my Controller Action, but it doesn’t get executed prior to the above error being shoen in IE. Any ideas how I can fix this?
OK…I found the answer but I don’t know why it works. I have some javaScript in the View that runs on the onchange event of the Drop Down list.
I changed the form submit to use jQuery:
This fixed the issue. I’d love to know why. I’ll see if I can’t find an answer