0

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

enter image description here

What can I do to fix this problem

1

2 Answers 2

1

In your post method of the following controller just add

<pre>
[HttpPost, ValidateInput(false)]
</pre>
Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.