Invalid postback or callback argument in GridView EmptyDataTemplat

G

Guest

I'm getting this error after adding a simple button to the EmptyDataTemplate
Invalid postback or callback argument. Event validation is enabled using
<pages enableEventValidation="true"/> in configuration or <%@ Page
EnableEventValidation="true" %> in a page. If the data is valid and
expected, use the ClientScriptManager.RegisterForEventValidation method in
order to register the postback or callback data for validation.]

Here's my template:
<EmptyDataTemplate>
<asp:Label ID="Label7" runat="server" Text="No Data Found."
Width="60px"></asp:Label>
<asp:Button ID="btnAddNew" runat="server" Text="New..."
OnCommand="btnAddNew_Command" CommandName="New" />
</EmptyDataTemplate>

Here's the event handler:
protected void btnAddNew_Command( object sender, CommandEventArgs e ) {
Response.Redirect( "RegistrantDetail.aspx?mode=insert" );
}


I have no idea why a simple button trigger's this exception, no less what to
register with the ClientScriptManager.RegisterForEventValidation method.

Any suggestions would be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top