Request Validation Asp.net

Asked

Viewed 315 times

1

I have a Textbox that uses the text editor ckeditor. When I run the method to save the information, it gives an error

A potentially Dangerous Request.Form value was Detected from the client (ctl00$Contentplaceholder1$fTxtConteud="

sdgfdsgdg

"). Description: ASP.NET has Detected data in the request that is potentially Dangerous because it Might include HTML Markup or script. The data Might represents an Attempt to Compromise the security of your application, such as a cross-site scripting Attack. If this type of input is appropriate in your application, you can include code in a web page to explicitly allow it. For more information, see http://go.microsoft.com/fwlink/? Linkid=212874. Exception Details: System.Web.Httprequestvalidationexception: A potentially Dangerous Request.Form value was Detected from the client (ctl00$Contentplaceholder1$fTxtConteute="

sdgfdsgdg

").

Already put the code in the <@ Page validateRequest="false" %> and it still didn’t work. I want to apply this permission only on this page, and not on the entire web site.config

Remembering that I am using Asp.net

2 answers

1

To do the job for ValidateRequest in . Net 4.0 or later, you will need to add the following configuration in web.config, section <system.web>:

<httpRuntime requestValidationMode="2.0" />

Once added, you can set validateRequest=false in the web.config or in the directive Page.

0

In your page directive, put the following code setting Validaterequest to false.

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="StackOverflowWEB._Default" ValidateRequest="false" %>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.