If I add multiple forms in a single page, do I need to add separate Anti-Forgery Tokens in each form?

There is nothing specific that you need to do in this case. ASP.NET MVC will simply reuse the same value for all forms so it doesn’t need to know which form sent the request in order to validate it. Simply put an Html.AntiForgeryToken() in each form and decorate each controller action you are posting to with the [ValidateAntiForgeryToken] attribute and you should be OK.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)