Hi, Im getting the error;
Using aps.net 3.5 I have a number of image buttons in my datagrid (template columns).
After some intense googling, it seems that the common fix for this is to not rely on the framework and explicitly register the events. So I have adjusted my Render Method as per below;
However, I still get the same error when I trigger the command. I can work round this in the dev environment by turning off event validation at the page level, but this is not acceptible on the production server. Can anyone suggest further things to try ro resolve this?
Thanks
K
Code:
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> 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.
Using aps.net 3.5 I have a number of image buttons in my datagrid (template columns).
After some intense googling, it seems that the common fix for this is to not rely on the framework and explicitly register the events. So I have adjusted my Render Method as per below;
Code:
foreach (DataGridItem item in dgManagePages.Items)
{
if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
{
ImageButton ib = item.Cells[0].FindControl("expandLevel") as ImageButton;
Page.ClientScript.RegisterForEventValidation(ib.UniqueID, String.Format("Command${0}", item.ItemIndex));
}
}
However, I still get the same error when I trigger the command. I can work round this in the dev environment by turning off event validation at the page level, but this is not acceptible on the production server. Can anyone suggest further things to try ro resolve this?
Thanks
K