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

Posted by Parthibansk under ASP.NET on 6/27/2014 | Points: 10 | Views : 493 | Status : [Member] | Replies : 1
A potentially dangerous Request.Form value was detected from the client (ContentPlaceHolder2_FreeTextBox1="<div><b>Hi,</b></div...").

i get this error when i insert html formatted data to databse on server in spite of adding <pages validateRequest ="false" /> in config file...

working on framework 2.0

it works locally fine but on server i encounter this issue...

how to resolve it..




Responses

Posted by: kgovindarao523-21772 on: 6/27/2014 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,

there are three ways to resolve it.
1. You have to do HtmlEncode before submitting form and decode it .cs file
2. specify validateRequest="false" in page directive
3. specify <pages validateRequest="false" /> in web.config

please find the reference.
http://www.asp.net/whitepapers/request-validation

Thank you,
Govind

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response