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

Asp.Net 4.0 - A potentially dangerous Request.Form value was detected after form submit with html tags in textbox

September 21, 2020

In this article we will cover how to resolve Error "A potentially dangerous Request.Form value was detected from the client in asp.net 4.0"

Web.config

Add below mentioned code int Web.config file.

<system.web>
		<httpRuntime requestValidationMode="2.0" />
	</system.web>

To resolve the issue on all pages add below code to the Web.config inside <system.web>

<pages validateRequest="false"></pages>

To Resolve the issue on specific page add ValidateRequest="false" to Page directory as shown below.

<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeFile="Aboutus.aspx.cs" Inherits="Aboutus" ValidateRequest="false" %>

Post Comments(0)

Leave a reply

Will not be displayed in comment box .

Loading...