Here Mudassar Ahmed Khan has explained with an example, how to use AntiForgeryToken with jQuery Unobtrusive AJAX in ASP.Net Core Razor Pages.
The jQuery Unobtrusive AJAX library does not support adding headers to the request and hence it is not possible to send AntiForgeryToken.
Thus, the possible way is to make use of normal jQuery AJAX function and then send the AntiForgeryToken by adding it to the request headers.
↧