Hi,
You need to add onclick handler to your buttons on the grid during RowCreated on the grid:
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button b = e.Row.FindControl("btn");
string IdValue =
b.Attributes.Add("onclick", string.Format("window.open('PageName.aspx?RecId={0}')", IdValue));
}
}
I hope it helps,
Cheers