i'm using this code for delete comment .
but when i delete comment , it not show me alert in success . what's the problem ?
function DeleteComment(id) {
jQuery.ajax({
url: "/Admin/Comment/DeleteComment/" + id,
dataType: 'json',
success: function (data) {
if (data === true) {
alert("نظر مورد نظر با موفقست حذف گردید");
} else {
alert("خطایی رخ داده ، نظر حذف نشد . لطفا خطا را بررسی کنید");
}
}
});
}
** Edit **
public JsonResult DeleteComment(int id)
{
var deletecomment = _CommentService.CommentByID(id);
if (_CommentService.RemoveComment(deletecomment))
{
return Json(true);
}
else
{
return Json(false);
}
}