Is this sucure way to get rid of problem;
The required anti-forgery form field "__RequestVerificationToken" is not present
function Delete(id) {
if (confirm('Are you sure to delete the record?')) {
var token = $('input[name="__RequestVerificationToken"]').val();
$.ajax({
type: "POST",
url: '@Url.Action("Delete", "Survey")/' + id,
data: {
__RequestVerificationToken: token
},
success: function (data) {
if (data.success) {
dataTable.ajax.reload();
$.notify(data.message,
{
className: "success",
globalPosition: "top center",
title: "BAŞARILI"
});
}
}
});
}
}
Sounds like it can be imitated. Could you please explain why or not?