I have two dropdownlists and I am filling one based on the other using javascript. In my javascript code I am calling for a webservice and with the results returned I fill the other dropdownlist. The problem is that after I have done that successfully the following error started to occur:
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.
Any idea ?
I got same Error when i got one of my clients project. It is related to the web.config file. Simply Paste the below code under appSettings in config file.
<add key="PageInspector:ServerCodeMappingSupport" value="Disabled" />
My problem was solved when cancel event at end of grid event at server side.
protected void grdEducation_RowEditing(object sender, GridViewEditEventArgs e)
{
// do your processing ...
// at end
e.Cancel = true;
}
I had to change the web.config in IIS
<configuration>
<system.web>
<pages enableEventValidation="false"/>
</system.web>
</configuration>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.