While working in mvc I got the below error.
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
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.
Way 3:
This can be implemented by making in changes in web.config file.
A potentially dangerous Request.Form value was detected from the client
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)]
|
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>
|
0 comments:
Please let me know your view