protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { int newIndex = e.NewSelectedIndex;//Row that the user is selecting(!e is a parameter) object EventID = GridView1.DataKeys[newIndex].Value; object stadiumID = GridView1.DataKeys[newIndex].Value; string Game = GridView1.Rows[newIndex].Cells[0].Text; string Location = GridView1.Rows[newIndex].Cells[1].Text; string Stadium = GridView1.Rows[newIndex].Cells[2].Text; string Date = GridView1.Rows[newIndex].Cells[3].Text; string Hour = GridView1.Rows[newIndex].Cells[4].Text; Session["data"]= string.Format("Event:{0}<br />Location:{1}<br />Stadium name:{2}<br />Date:{3}", Game, Location, Stadium, Date); Session["StadeID"] = stadiumID; Session["EventID"] = EventID; Response.Redirect("BuyTicketPage.aspx");
If(IsPostBack) Response.Redirect("BuyTicketPage.aspx");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)