技巧在ItemDataBound事件里做
//假设第一列为超级链接列
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
string ID = "123";
string Name = "user";
if ( ( e.Item.ItemType != ListItemType.Header ) && ( e.Item.ItemType != ListItemType.Footer ) )
{
e.Item.Cells[0].Text = "<a href=" + ( ( HyperLink ) e.Item.Cells[0].Controls[0] ).NavigateUrl + "&ID=" + ID + "&Name=" + Name + ">" + ( ( HyperLink ) e.Item.Cells[0].Controls[0] ).Text + "</a>";
}
}
[技巧]DataGird的hyper column的url field 绑定两个字段
80酷酷网 80kuku.com