Created
September 16, 2021 19:08
-
-
Save awright18/afcb06347fd9b1b1d8d0e651592a5e9b to your computer and use it in GitHub Desktop.
Razor Pages Ignore Antiforgery Token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.RazorPages; | |
namespace RazorPagesDemo.Pages | |
{ | |
[IgnoreAntiforgeryToken] //this will allow post without Antiforgery tokens. Good for Ajax style requests | |
public class Clicked : PageModel | |
{ | |
public void OnGet() | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment