Click here to Skip to main content
15,357,682 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,

I am using kendo ui editor controll.
I want to save editor control data in the database.
i am passing data follwing way.

C#
$(function () {
    $("#btnSave").on("click", function (e) {
        $.ajax({
            type: "Post",
            url: '/Home/Add',
            data: $("#editorControl").data("kendoEditor"),
            datatype: 'json',
            success: function (data) {
                location.href = '/Home/Index';

            },
            error: function (e) {
                console.log(e);
            }
        });
    });
});


but i am getting the null model in controller.
Can any one help me on this

Regards,
Viprat
Posted
Updated 24-Apr-22 0:18am

1 solution

you should write below code:
$(function () {
    $("#btnSave").on("click", function (e) {
        $.ajax({
            type: "Post",
            url: '/Home/Add',
            data: { Content: $("#editorControl").data("kendoEditor").value() },
            datatype: 'json',
            success: function (data) {
                location.href = '/Home/Index';

            },
            error: function (e) {
                console.log(e);
            }
        });
    });
});
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900