shmulik hazan
shmulik hazan

Reputation: 193

Sending a gridview selected row with session

I want to send a gridview selected row in C# with Session.

I try to save the row like this:

 protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        Session["try"] = GridView1.SelectedRow;
        Response.Redirect("ProjectInformation.aspx");
    }

Then , in ProjectInformation.aspx i want to retrieve the row from the Session but i dont know how to do it . can anyone help please?

Upvotes: 1

Views: 1219

Answers (1)

Jameem
Jameem

Reputation: 1838

Can you please try this in the pageload of your redirected page..

GridViewRow a = (GridViewRow)Session["try"];

Give Header file using System.Web.UI.WebControls;

Upvotes: 2

Related Questions