0

I am getting this in ASP.NET 4 webforms. Now I know the user sends HTML in the textbox. my problem is that I want to alert him that he entered HTML and invalid content.

How can I do that?

Thanks

Himberjack
  • 5,682
  • 18
  • 71
  • 115
  • 1
    Similar post http://stackoverflow.com/questions/81991/a-potentially-dangerous-request-form-value-was-detected-from-the-client – BizApps Dec 15 '11 at 06:05

2 Answers2

1

Setting validateRequest="false" will avoid this error, but it will leave the page vulnerable to a number of attacks which may be sql injection attacks also. Or use HTMLEncode on all fields where you are taking input.

For more detailed explanation have a look at following Stackoverflow question about handling suspicious content:

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

Hope this helps.

Community
  • 1
  • 1
talha2k
  • 24,937
  • 4
  • 62
  • 81
0

I recomend to Parse the HTML Content entered by the user in your browser.