在itemdatabind()中做
if (e.Item.ItemIndex>-1)
{
DataTable dt=)(DataTable)dgList.DataSource

int pid=(int)dt.Rows[e.Item.ItemIndex][0];
string name=dt.Rows[e.Item.ItemIndex][1];
e.Item.Cells[5].Attributes.Add("onclick","window.location.href='AfficheManager_Edit.aspx?name="+name+"&id="+ pid+"'");