Vishal Shrestha
Vishal Shrestha

Reputation: 354

Invalid postback or callback argument

Following error occurred on my web application while postback,

Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

I figured out the solution adding following code to web.config file:

<pages
    buffer="true"
    masterPageFile="~/masterpages/Main.Master"
    enableEventValidation="false">
</pages>

However adding the secondary code, will there be a security concern? Are there alternatives to achieve the same with better security control?

Upvotes: 0

Views: 972

Answers (1)

Riddi Kumar Shrestha
Riddi Kumar Shrestha

Reputation: 98

Try to do like this in your Page_Load

if (!Page.IsPostBack)
{ 
//do something 
}

may this will help you.

Upvotes: 2

Related Questions