It turns out the problem lay in the textarea
itself. In the view it was just a standard textarea
, but in Javascript document.Ready
was then made to be a kendoEditor
. The kendoEditor
was encoding the HTML first, then ASP.net was applying its standard encoding as well. Setting the attribute encoded
equal to false fixed the issue:
$("#editor").kendoEditor({
encoded: false
});
Update:
I found later that setting the encoded
attribute to false would introduce another problem. On submit I received a "A potentially dangerous Request.Form value was detected from the client" error when using formatting tools from the built-in KendoEditor
toolbar. My solution was to double-decode the posted request:
WebUtility.HtmlDecode(WebUtility.HtmlDecode(Request["value"]));