ASP.net submission error

When I try to start a forum page:

System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client 

In my web.config, I have:

<pages validateRequest="false" smartNavigation="false">

And on the actual page, I also have:

<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" MasterPageFile="~/MasterPages/Main.master" %>

But he continues to throw this mistake!

Edit

I fixed it with

<httpRuntime requestValidationMode="2.0" />

But what does it do and why does it work?

+3
source share
2 answers

This error occurs because something in the submitted form or in the query string looked dangerous for validation in ASP.NET.

By adding

<httpRuntime requestValidationMode="2.0" />

you relax the validation that applies back to ASP.NET 2 standards.

, , , /querystring, . , .

, , ASP.NET MVC3 ( 2). , , (.. , , url, ).

, , , .

+5

, . http://www.asp.net/learn/whitepapers/aspnet4/breaking-changes

ASP.NET - (XSS). ASP.NET, . ASP.NET ( .aspx ), .

ASP.NET 4 , BeginRequest HTTP . ASP.NET, .aspx- . - HTTP- . , HTTP- HTTP .

, . ASP.NET 2.0, Web.config:

<httpRuntime requestValidationMode="2.0" />
+5

All Articles