Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sanwar RanwaRank #23 · 44.7K reputationPosted Jan 4, 2019, 6:24 PM EST
Rajeesh MenothRank #118 · 18.4K reputationPosted Jan 4, 2019, 10:54 PM EST
Suraj KumarRank #353 · 7.1K reputationPosted Jan 5, 2019, 12:05 AM EST
You could try the following. In the Web-Form add:
ViewStateUserKey & Double Submit Cookie
Starting with Visual Studio 2012, Microsoft added built-in CSRF protection to new web forms application projects. To utilize this code, add a new ASP .NET Web Forms Application to your solution and view the Site.Master code behind page. This solution will apply CSRF protection to all content pages that inherit from the Site.Master page.
The following requirements must be met for this solution to work:
All web forms making data modifications must use the Site.Master page. All requests making data modifications must use the ViewState. The web site must be free from all Cross-Site Scripting (XSS) vulnerabilities. See how to fix Cross-Site Scripting (XSS) using Microsoft .Net Web Protection Library for details.
Rohan GuptaRank #2,588 · 539 reputationPosted Jan 7, 2019, 6:18 PM EST
Sanwar RanwaRank #23 · 44.7K reputationPosted Jan 7, 2019, 6:21 PM EST
Rohan GuptaRank #2,588 · 539 reputationPosted Jan 7, 2019, 6:48 PM EST