"A potentially dangerous Request.Form value was detected from the client" fix for ASP.NET MVC
Here is a gotcha that I found while I had my "WebForms" hat on.
I've been working on a project and got the dreaded error:
"A potentially dangerous Request.Form value was detected from the client"
Well, after trying the "<@page validateRequest="false"...>", I realized that didn't work. So I started looking through the code and found the attribute:
[ValidateRequest(false)]
You need to attach the ValidateRequest(false) attribute to the method that is receiving the post.
Problem solved.
NOTE: However, make sure you are catching any type of malicious injections that could occur.
Tools
Jonathan Danylko is a freelance web architect and avid programmer who has been programming for over 20 years. He has developed various systems in numerous industries including e-commerce, biotechnology, real estate, health, insurance, and utility companies.
When asked what he likes doing in his spare time, he answers..."programming."
Like this article?Subscribe for FREE to receive the latest posts before they become public.
Related Posts
- Security in Web Applications
- UPDATE: Multiple Project Area Support for ASP.NET MVC 2 RC
- MapAreaRoute Removed from ASP.NET MVC 2 RC
- Speed Links: ASP.NET MVC
- Microsoft Monday: August 17, 2009

RSS Links
Share


http://www.a2zmenu.com/AspNet/A-potentially-dangerous-Request-Form-value-was-detected.aspx