所以我使用TEXTAREA
标签发送评论文本(最多 1500 个字符)但它不起作用。
当我只用几个词发送时,它工作正常。
任何线索,伙计们?
错误
Failed to load resource: the server responded with a status of 400 (Bad Request)
JS
var commentText = $("#commentTextArea").val();
if (commentText.length > 0) {
var urlGetComments = window.location.protocol + '//' + window.location.host + "/Gadget/PostComment/" + userId + "/" + commentText;
$.ajax({
type: "POST",
url: urlGetComments,
data: "",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (dataComments) {
if (dataComments.html != null) {
$('#divCommentsData').html(dataComments.html);
}
}
});
}
C#
[AcceptVerbs("POST")]
[HttpPost]
[ValidateInput(false)]
public JsonResult PostComment(string userId, string commentText)
{
try
{