thanks Mudassar sir ,and niravjp for ur response
i have solved this issue
code something like this
for example a product gridview with checkbox
save recent product details in session where checkbox checked
DataTable dt = new DataTable();
dt.Columns.Add("ProductID", typeof(int));
dt.Columns.Add("ProductName", typeof(string));
dt.Columns.Add("CategoryID", typeof(int));
dt.Columns.Add("UnitPrice", typeof(decimal));
foreach (GridViewRow gvRow in GridView1.Rows)
{
CheckBox checkbox = (CheckBox)gvRow.Cells[0].FindControl("CheckBox1");
if (checkbox.Checked)
{
DataRow row = dt.NewRow();
row["ProductID"] = gvRow.Cells[1].Text;
row["ProductName"] = gvRow.Cells[2].Text;
row["CategoryID"] = gvRow.Cells[3].Text;
row["UnitPrice"] = gvRow.Cells[4].Text;
dt.Rows.Add(row);
}
}
Session["ProductsTable"] = dt;
Response.Redirect("~/Default2.aspx");
on second page
if (Session["ProductsTable"] != null)
{
DataTable dt = (DataTable)Session["ProductsTable"];
GridView1.DataSource = dt;
GridView1.DataBind();
Session["ProductsTable"] = null;
}