|
Since the data of each row is different in state timing, to distinguish different rows, you need to find a keyword.
private void DataGrid1_ItemDataBound_1(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
//Fake code
Session["key"+key value of data, such as id as the key of Session] = e.Item.Cells[0].Text;
e.Item.Attributes.Add ("onclick","window.open('yl.aspx?ID="+ key value of data, such as id as the key of Session + "')");
}
In addition, when getting the Session, you need to pass this keyword to get the correct data without confusion. |
|