ASPX页面: 代码: protected void grid1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "this.backgroundColor='#F00'"; e.Row.Attributes["onmouseout"] = "this.backgroundColor='#FFF'"; } }