Sunday, February 20, 2011

How to deal with exception: "A potentially dangerous Request.Form value was detected from the client" in ASP.NET Webform

Cause: the content user posts in the textbox includes bracket: < >. "Request validation detects potentially malicious client input and throws this exception to abort processing of the request"

You can turn off this validation by:

  <location path="pagename.aspx">
      <httpRuntime requestValidationMode="2.0" />
      <pages validateRequest="false" />