在DataGrid的绑定事件里写!
private void Mdb_Dealer_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
{
e.Item.Attributes.Add ("onmouseover","currentcolor=this.style.backgroundColor;this.style.backgroundColor='#ECECEC'");
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=currentcolor");
e.Item.Attributes.Add("onclick","window.open('DealerRevise.aspx?DEALER_ID=" + e.Item.Cells[1].Text +"&PageIndex="+Mdb_Dealer.CurrentPageIndex+"','_blank','menubar=no,resizable=no,status=yes,location=no,height=600,width=800')");
}
}

浙公网安备 33010602011771号