0
votes

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?

1
You haven' shown anything of your page, so how could be help to fix the issue? What is causing the error? Where do you modify controls at clientside? - Tim Schmelter
i have completed localization in my project and when i add enableEventValidation="false" in web.config it works perfectly but when we use this code there will be problem in security purpose so i was asking if there is any alternative for this - Vishal Shrestha

1 Answers

2
votes

Try to do like this in your Page_Load

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

may this will help you.