0

I maintain a VB.net webforms application and need to add anti-CSRF measures. I have read that support is provided for projects that utilize master pages, however my project does not use them. How can I add the AntiForgeryToken method to my classic ASP.NET VB.NET web forms pages?

Here is related link Generating AntiForgeryToken in WebForms

user2055729
  • 199
  • 1
  • 1
  • 13
  • 1
    I've had some success in implementing it using the Global.asax file and a custom "handler". An alternative is to create an "intermediate" class that inherits from System.UI.Page and then have every page inherit the intermediate class. This intermediate class will then have the same logic that the master page would have and the same methods except they are triggered by the individual page's events. My scenario uses C# but I'm sure the same principle could be applied to VB.net – Daniel Dec 11 '19 at 10:55
  • Thanks for the advice. I was hoping for a more detailed solution but I appreciate the guidance – user2055729 Dec 11 '19 at 17:20

0 Answers0