24-06-2026
Yes, there are a few mismatching pieces between your JavaScript fetch request and your C# Controller method that are keeping them from connecting.
Here are the main issues causing the breakdown, ranked from most critical to least:
In your JavaScript, you are passing the token using the header key 'RequestVerificationToken':
JavaScript
However, standard ASP.NET MVC’s [ValidateAntiForgeryToken] attribute looks for a header named __RequestVerificationToken (with two underscores), or it expects it inside the request body. Because the names don't match, your server is likely rejecting the request with a 403 Forbidden or 500 error before it even hits your controller action.
Your C# controller is expecting a parameter called prmBlogId from the URL route, but it isn't expecting the status variable you are sending in the body.
'status=' + statusint prmBlogIdIf you actually want to use that status boolean inside your controller, your C# method needs to accept it.
Here is the corrected code for both sides to make sure they talk to each other flawlessly.
JavaScript
We’d love to hear from you. Please fill out this form.