hello sir , i have issue with button click event in gridview . i want do something on btton click event below is the error
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.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField HeaderText="Name" DataField="name" />
<asp:BoundField HeaderText="Member_id" DataField="unique_id" />
<asp:BoundField HeaderText="Batch" DataField="batch" />
<asp:BoundField HeaderText="Regd_no." DataField="regd_no" />
<asp:BoundField HeaderText="Branch" DataField="branch" />
<asp:BoundField HeaderText="Email" DataField="email_id" />
<asp:BoundField HeaderText="Status" />
<asp:TemplateField HeaderText="Approve">
<ItemTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void Button1_Click(object sender, EventArgs e)
{
GridView grd = (GridView)((Button)sender).NamingContainer;
string name = grd.SelectedRow.Cells[0].Text;
}