I put EnableEventValidation="false" in <@Page ... > and it solved my
problem. But I would like to understand what is this problem and when
and why it happens. If someone can explain in newbie language I
appreciate =)

On Sep 1, 3:06 pm, Ana <[email protected]> wrote:
> Hello everyone,
>
> I have a GridView as follows:
>
> --
> <asp:GridView ID="GridView1" AutoGenerateColumns="False"
> DataKeyNames="ID"
>         OnSelectedIndexChanged="GridView1_OnSelectedIndexChanged"
> runat="Server"
>         Width="800px" PageSize="35" AllowPaging="true">
>         <Columns>
>             <asp:TemplateField HeaderText="Title">
>                 <ItemTemplate>
>                     <asp:Label ID="TitleLabel" runat="server" Text='<
> %#Eval("Title")%>' />
>                 </ItemTemplate>
>             </asp:TemplateField>
>             <asp:TemplateField HeaderText="Move" ItemStyle-
> HorizontalAlign="Center">
>                 <ItemTemplate>
>                     <asp:Button ID="MoveUpButton" Text='<%#
> Server.HtmlDecode("Up &uarr;") %>' runat="server"
> OnClick="MoveUpButton_Click" /> &nbsp;
>                     <asp:Button ID="MoveDownButton" Text='<%#
> Server.HtmlDecode("Down &darr;") %>' runat="server"
> OnClick="MoveDownButton_Click" />
>                 </ItemTemplate>
>             </asp:TemplateField>
>             <asp:ButtonField Text="Details..." HeaderText="Show
> Details" CommandName="Select" ItemStyle-HorizontalAlign="Center">
>             </asp:ButtonField>
>         </Columns>
>     </asp:GridView>
> --
>
> What is happening is, when I click on MoveUp Button I have this error
> message:
>
> 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.
>
> The error occurs before the MoveUpButton_Click method be called. This
> method is in the code behind but do nothing at this moment.
>
> --
> Protected Sub MoveUpButton_Click(ByVal sender As Object, ByVal e As
> System.EventArgs)
>
> End Sub
> --
>
> What is happening here? What is wrong? Why I'm having this error?
>
> Thanks,
>
> Ana

Reply via email to