I'm using CLEditor to provide an html editor for my app user, CLEditor use an text area to maintain the generated html, I'm using jquery ajax to save the html:
$(".btnSave").click(function () {
var description = $(this).find("textarea[name='Description']").val();
$.ajax({
url: "/Product/SaveDescription",
data: { description: description },
success: function (result) {
alert("Saved successfully.");
},
error: function (xhr, state, msg) {
alert(msg);
}
});
});
but when my variable (description) contains html tags the action won't trigger , and I get an error (internal server error).
This is my action method:
public void SaveDescription(string description)
{
//save the description
}
As you can see I'm not using MVC model binder which need AllowHtml attribute to allow html, so what is the problem?
Thanks for your help.