Sunday, 4 December 2016

Asp.net MVC : A potentially dangerous request.form value was detected from the client mvc

12/04/2016 - By Pranav Singh 0

While working in mvc I got the below error.

A potentially dangerous Request.Form value was detected from the client



So here is solution for above error. There are multiple ways by which we can prevent the above error.

Way 1 :
On Model property which is used for html content, add the below attribute

  [AllowHtml]

 Way 2:
This solution will help to prevent the above by adding attribute at controller end. So on controller action add this attribute to allow all HTML.

[ValidateInput(false)]


 Way 3:
This can be implemented by making in changes in web.config file.

<configuration>
    <system.web>
        <httpruntime requestvalidationmode="2.0" />
    </system.web>
    <pages validaterequest="false">
    </pages>
</configuration>



About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Global Classified : Connectseekers.com
© 2014 aspdotnet-pools.com Designed by Bloggertheme9.
back to top