This question seems to have been asked before, but I feel like my situation is slightly different.
I have a page that contains a gridview. When a button is pressed to edit one of the records in the gridview, the button first executes some client script that pops up a modal window for the purposes of editing (set using .onClientClick). From this pop-up, the user hits Update which updates the database and closes the window. Once the window is closed, the button's server-side code is supposed to fire, which will call the function to refresh the gridview. Instead, I get the error message:
Invalid postback or callback argument. Event validation is enabled using in configuration or 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.
What really irks me is that I use this exact same logic on a different page and it works fine.
Any suggestions as to how I could avoid this?
UPDATE: I have removed the line of code that added the client-side script, and I still get the error. So I'm fairly positive it is being caused simply by the postback. Upon closer inspection I realize that there are in fact some ListItems being programatically bound to DropDownLists. So... I probably need to do the ClientScriptManager.RegisterForEventValidation thing.... Could someone possibly give me an example on what the syntax for doing that would look like? Seems to be set up differently than the ScriptManager object....