Welcome Guest Search | Active Topics | Sign In | Register

Callback error after grid is taken out of edit mode Options
Joan Darling
Posted: Monday, December 15, 2014 12:09:08 PM
Rank: Advanced Member
Groups: Member

Joined: 3/9/2010
Posts: 119
I have a grid - running mode: client, full row select: true. It has and edit column, 2 datepicker columns, and a custom column containing a dropdownlist. When I click the edit link the row goes into edit mode with no problem but when I click update or cancel I get the following exception.

Exception: System.ArgumentException: 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.
at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument)
at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument)
at System.Web.UI.WebControls.DropDownList.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


any ideas what could be causing this error?
eo_support
Posted: Tuesday, December 16, 2014 10:24:13 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,066
Hi,

This would indicate a problem somewhere. You would get this error if you have a server control that has not registered as an event source during the initial page load stage but when the page posts back, it indicates that there is a server event for that control. The Grid should not cause a server event when Update button is clicked. So it should not even go back to the server side, let alone to trigger a "wrong" event.

You may want to try to isolate the problem into a test page and see if you can identify what triggered the problem for you. If you have isolated the problem and still can not identify the trigger, you can either post your test page here or email it to us. We will take a look as soon as we have that.

Thanks!
Joan Darling
Posted: Wednesday, December 17, 2014 5:27:57 AM
Rank: Advanced Member
Groups: Member

Joined: 3/9/2010
Posts: 119
I tracked down the problem. When the edit button is clicked it is causing the window.onbeforeunload event to fire. I have a callback in the function connected to this event to write back any changes to the grid data if the user navigates away to prevent data loss. Any idea why this event would be triggered?
eo_support
Posted: Wednesday, December 17, 2014 9:50:06 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,066
Hi,

You can try to create a separate page, or compare your page with our sample project to see if you can find out what triggered the problem. The Grid edit button should not trigger window.onbeforeunload.

Thanks!
Joan Darling
Posted: Wednesday, December 17, 2014 12:02:09 PM
Rank: Advanced Member
Groups: Member

Joined: 3/9/2010
Posts: 119
I found the true culprit and it was that I was changing the options collection on the custom column's dropdownlist on the client side because the options list is conditional and may not be the same for each gridItem. Is there a way to load the dropdown list conditionally to avoid this situation?
eo_support
Posted: Wednesday, December 17, 2014 12:39:50 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,066
Hi,

In that case please do not use a server control for the option list but use a <select> element directly.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.