Invalid callback or callback argument. Debugging question

I get the error message: “Invalid postback or callback argument. Event checking is enabled using either in the configuration or on the page. For security reasons, this function checks that the arguments for postback or callback events come from the management server that was initially displayed If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method to register the postback or callback data for validation. " Event validation is enabled using the configuration or on the page. I do not modify the data in the controls through javascript. The error is very rare, and I only know about it because of some automatic emailing that I set when exceptions are thrown.What is the best way for me to find the reason for the exception? Is it possible that in some cases some text entered in the text field causes this error, and I need to do Html Encode? When will I do the encoding?

+3
source share
3 answers

If the problem is very rare, it usually means that some users sent the page quickly or had a very bad connection, which prevents the entire hidden mechanism of the JavaScript JavaScript request from being used.

+1
source

I often came across this problem when the user submits a form with a potentially dangerous character in the field ('<', '>', etc.). If your page should allow these characters to be submitted on the form, you need to set the page level property ValidateRequest to false.

Ref.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyClass.cs" Inherits="MyClass" ValidateRequest="false" %>

( ), , , , . , . , , .NET ValidateRequest.

+1

, , - "" form runat="server" URL- ( , ).

-edit: , , , , ,

0
source

Source: https://habr.com/ru/post/1707607/


All Articles