Reputation: 1362
I want to send data as Html to controller and save in database. I try to send data as html but I failed.
Here is code
$("#savechanges").click(function () {
$("#notify").val($("#notify_to").val());
//here I want to send html to controller
$("#editor").val($("input[name='" + "Editor2" + "']").val());
$("#nid").val($(".notifybox").attr('id'));
$("#form_editing").submit();
});
When I click save button then this error shows
What can I do to fix this problem
Upvotes: 0
Views: 816
Reputation: 520
In your post method of the following controller just add
<pre>
[HttpPost, ValidateInput(false)]
</pre>
Upvotes: 1
Reputation: 427
Try to add "requestValidationMode=2.0" in your .config:
<httpRuntime requestValidationMode="2.0"/>
For more details: A potentially dangerous Request.Form value was detected from the client
Upvotes: 0