I have a form with a textarea (tinymce) for input content. When I perform an ajax request, I got the error:
A potentially dangerous Request.Form value was detected from the client
Then I've tried something like
html.encodeURIComponent()
or escape()
but the error is still here
HTML:
<form id="editForm" action="" method="post">
<input type="text" id="title" name="title" />
<textarea id="content" name="content"></textarea>
<input type="button" id="submit" onclick="Submit();" />
</form>
Script (I use jQuery)
function Submit(){
$.ajax({
url: 'ajax.aspx?type=addcontent&' + $('#editForm').serialize() + '&rnd=' + Math.random(),
success: function(data) {
alert('OK');
}
});
}
As soon as I press the submit button, the error appears. No ajax request is made. I've tried add ValidateRequest="false"
to the aspx page but the problem is still here.
Any help is appreciated!