我在GridView中有
 <asp:TemplateField HeaderText="属性">
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" Width="50px" />
<ItemTemplate>
                                    <asp:ImageButton ID="ImageButton9" runat="server" CommandArgument='<%# Eval("FileId") %>'
                                        CommandName="detail" ImageUrl="~/images/file/detail.gif" Style="position: relative"
                                        ToolTip="属性" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="转移">
                                <ItemStyle HorizontalAlign="Center" />
                                <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButton10" runat="server" CommandArgument='<%# Eval("FileId") %>'
                                        CommandName="move" ImageUrl="~/images/file/fmmove.gif" Style="position: relative"
                                        ToolTip="转移" />
                                </ItemTemplate>
                            </asp:TemplateField>
以上两个按钮,页面每次显示的时候都显示CommandArgument参数都是同样的值,而且在点击按钮的时候还报错说
回发或回调参数无效。在配置中使用 <pages enableEventValidation="true"/> 或在页面中使用 <%@ Page EnableEventValidation="true" %> 启用了事件验证。出于安全目的,此功能验证回发或回调事件的参数是否来源于最初呈现这些事件的服务器控件。如果数据有效并且是预期的,则使用 ClientScriptManager.RegisterForEventValidation 方法来注册回发或回调数据以进行验证。 
各位帮忙解决一下了

解决方案 »

  1.   

    <pages enableEventValidation="true"/> 换成false
      

  2.   

    这样做了 RowCommand事件就不起作用了呀
      

  3.   

    两个绑定的字段一样,所以commandArgumen一样,吧commandArgument的绑定到不同的field
      

  4.   

    protected void gvUpload_RowDataBound(object sender, GridViewRowEventArgs e)
       {
          e.Row.ID = Guid.NewGuid().ToString();
       }这样就可以解决~~~~