private void dgRoleByEmp_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","this.style.backgroundColor='#D6ECFC'");
}
if (e.Item.ItemType == ListItemType.Item)
{
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor='#FFFFFF'");
}
if (e.Item.ItemType == ListItemType.AlternatingItem)
{
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor='#EFF3FF'");
}
}上面的所有背景色是写在程序里的,领导要求用css里面的,怎么做啊