07-23-2023, 08:38 AM
In my case, I needed to replace this:
@Html.ActionLink("Return license", "Licenses_Revoke", "Licenses", new { id = userLicense.Id }, null)
With this:
<a href="#" onclick="returnLicense(event)">Return license</a>
<script type="text/javascript">
function returnLicense(e) {
e.preventDefault();
$.post('@Url.Action("Licenses_Revoke", "Licenses", new { id = Model.Customer.AspNetUser.UserLicenses.First().Id })', getAntiForgery())
.done(function (res) {
window.location.reload();
});
}
</script>
Even if I don't understand why. Suggestions are welcome!
@Html.ActionLink("Return license", "Licenses_Revoke", "Licenses", new { id = userLicense.Id }, null)
With this:
<a href="#" onclick="returnLicense(event)">Return license</a>
<script type="text/javascript">
function returnLicense(e) {
e.preventDefault();
$.post('@Url.Action("Licenses_Revoke", "Licenses", new { id = Model.Customer.AspNetUser.UserLicenses.First().Id })', getAntiForgery())
.done(function (res) {
window.location.reload();
});
}
</script>
Even if I don't understand why. Suggestions are welcome!