Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What if i am not using form tag in my view. I just Load partial view in js like
($(#DivId).load("/AcrtionName/ControllerName")).

How can i Validate AntiForgeryToken in this Case ?

What I have tried:

no idea what to do... as i can handle it with ajax call...bt don't know how to do with direct load call
Posted
Comments
Richard Deeming 9-Feb-18 8:53am    
Why would you need to? The load method makes a GET request, whereas anti-forgery tokens are intended to protect POST requests.

If your GET request is changing data, then you're doing it wrong. If it's not changing data, then there's no need for an anti-forgery token.

When the use of a AntiForgeryToken is not required /needed?[^]
sachin.vishwa90 9-Feb-18 9:27am    
good catch

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900