Andrew Van

Andrew Van

  • NA
  • 1
  • 0

Passing Gridview Values to Session

Nov 9 2009 10:10 AM
Hi, I need some serious help with this one. I have a gridview and it finds all the records associated with a given user, i want to extract one cell(QueryID) to session and have a gridview reference this session variable in another page. I have no code in the second page and very little in the first page. Does anyone have any ideas on where i can get started? thanks in advance protected void Page_Load(object sender, EventArgs e) { string username = Session["UserName"].ToString(); TextBox1.Text = username; } protected void CloseButton_Click(object sender, EventArgs e) { } protected void MessageButton_Click(object sender, EventArgs e) { Response.Redirect("AddMessage.aspx"); } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { Session["QueryID"] = GridView1.SelectedRow.Cells[0]; }


Answers (1)