views:

568

answers:

0

I have a form that updates a gridview in an update panel via a search button. I also have a reset button that clears the form fields and updates the panel again (removing the search parameters). The problem is that the reset button throws an Event Validation Error (see details below) I have tried everything I can think of to fix this but cannot get it fixed. It works fine in FireFox, and only gives the error in IE. I have tried:

  • Registering Blank("Reset") values for each form element. Example:

    Page.ClientScript.RegisterForEventValidation(ResetButton.UniqueID)
    Page.ClientScript.RegisterForEventValidation(FirstNameTxt.UniqueID, "")
    Page.ClientScript.RegisterForEventValidation(EmailTxt.UniqueID, "")
    
  • Registering the form reset function with the script manager.

    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference path="../../js/resetForm.js" />
        </Scripts>
    </asp:ScriptManager>
    

The javascript in resetForm.js:

function resetForm()
{
    document.aspnetForm.reset()
}

The reset button is also registered as a Async postback trigger for the update panel. None of this seems to do anything. Anyone have any other suggestions on how to fix this? Or does anyone know how I can get a more specific error message? I don't even know what it is exactly that is causing the error, and like I said I have tried everything.

Thanks! PS: I CANNOT disable event validation.

Error Details:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729) Timestamp: Thu, 9 Jul 2009 14:49:36 UTC

Message: Sys.WebForms.PageRequestManagerServerErrorException: 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. Line: 4723 Char: 21 Code: 0 URI: http://localhost/ScriptResource.axd?d=B8UgpXOXIjA4LCk0srFSV7cOOlwXO2-1HyGUemsd2U1H7lGdSnF93IGI5axeGzsgahf2WGY2ahgZK5DVL1YPj6cOLm48d71bE0XNCCjxaoM1&amp;t=5fa4e27