Как я могу контролировать мою Ajax Beginform для отправки только один раз, когда пользователь нажимает кнопку несколько раз?
вот код моей ajax beginform
@using (Ajax.BeginForm("Create", "EMP_EDUC",
new AjaxOptions
{
OnSuccess = "getList",
OnFailure = "OnFailure",
}))
{
Функция успеха
<script>
function getList() {
setTimeout(
function () {
$.ajax({
url: '@Url.Action("Index", "EMP_EDUC", new { id = Model.eMP.lineno })',
type: 'get',
cache: false,
async: true,
success: function (result) {
Swal.fire(
'Good job!',
'Your Education has been updated!',
'success'
)
$('#List').html(result);
}
});
}, 500);
CloseModal();
}
</script>
Функция Onfail
</script>
function OnFailure(data) {
alert('uh oh');
}
</script>