I am trying to pass a HTML string as a parameter through the following means:
$.ajax({
url: sourceUrl,
type: "GET",
cache: false,
success: function (data, status, jqxhr) {
etc...
}
where sourceURL is a call to a C# Controller action with a parameter that contains a HTML string (from a Rich Text Box). Something like:
var sourceURL = "ThisController/ThisAction?Parameter=" + varWithHTML;
However it fails stating:
A potentially dangerous Request.QueryString value was detected from the client
(description="<p>Rich Text String</p>").
I have tried wrapping the string in a encodeURI():
encodeURIComponent(varWithHTML)
but still the same problem. I have also another suggestion for this issue in web.config:
<httpRuntime requestValidationMode="2.0" />
And still no luck. Am I going mad or is there a way to get around this?
dataargument?