vielkacarolina1239
asked on
how to fix an ASP.NET 2.0 error?
Hi, I am getting the following error:
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="tru e"/> in configuration or <%@ Page EnableEventValidation="tru e" %> 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.Regist erForEvent Validation method in order to register the postback or callback data for validation.
Please, can some one help?
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="tru
Please, can some one help?
ASKER
The looping of the dropdown menus is been done in the Page_Load event of the ascx.cs file
ASKER
I also found that I need to implement IPostBackDataHandler interface for the control that is been changed in the Page_Load event. This will register the changes in the dropdown menus and update the ViewState for this control accordantly when I pass the dropdown menu to the following method.
RegisterRequiresPostBack(m yDropDownM eny)
Please, can some one show me how to implement IPostBackDataHandler interface for a drop down menu so that I can use RegisterRequiresPostBackt( ) and this will update the ViewState when there is a changed in a drop down menu?
RegisterRequiresPostBack(m
Please, can some one show me how to implement IPostBackDataHandler interface for a drop down menu so that I can use RegisterRequiresPostBackt(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I understand why I am getting this error. The reason is that I have a web user control that contains 4 dropdown menus. I loop through all 4 drop down menus and set some data into the drop down menus controls in the ascx.cs file.
DropDownList[] dropDownListArr = new DropDownList[12];
dropDownListArr[0] = DropDownList0;
dropDownListArr[1] = DropDownList1;
dropDownListArr[2] = DropDownList2;
dropDownListArr[3] = DropDownList3;
for (int i = 0; i < 4; i++)
{
dropDownListLabelArr[i].Te
}
I know that if I use the following code in the web config, the problem will go away
<pages enableEventValidation="fal
However, I don't whant to use the above line of code. Is there another way to solf this problem?