Use
RowCommand
Event:
Page1.aspx:
In Select Button of Gridview add command name:
<asp:button id="Button1" runat="server" text="Button" commandname="Select" xmlns:asp="#unknown" />
In
RowCommand
event of Gridview:
if (e.CommandName == "Select")
{
ImageButton img = (ImageButton)e.CommandSource as ImageButton;
GridViewRow row = img.NamingContainer as GridViewRow;
Label name = (Label)row.FindControl("label1");
Session["Value"] = name.Text;
Response.Redirect("page2.aspx");
}
In page_load of page2.aspx:
TextBox1.Text = Session["Value"].ToString();