Hello mates
I have a linkbutton column in a gridview. It shows order numbers & I want to go to another page showing the order lines when one of the order number links is clicked
Ive used the following code but the value of Cells[0] is always blank. I think this would work if it were a normal cell but not here because its a button. I need to reference it a different way?
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow selectedRow = GridView1.Rows[index];
TableCell OrderNo = selectedRow.Cells[0];
Session["OrderNo"] = OrderNo.Text;
Response.Redirect("my other page");
}
I have a linkbutton column in a gridview. It shows order numbers & I want to go to another page showing the order lines when one of the order number links is clicked
Ive used the following code but the value of Cells[0] is always blank. I think this would work if it were a normal cell but not here because its a button. I need to reference it a different way?
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow selectedRow = GridView1.Rows[index];
TableCell OrderNo = selectedRow.Cells[0];
Session["OrderNo"] = OrderNo.Text;
Response.Redirect("my other page");
}