在GridView控件的RowDataBound事件里添加以下代码 if (e.Row.RowType == DataControlRowType.DataRow) { //当鼠标移到行上时更改背景色 e.Row.Attributes.Add(“onmouseover”, “c=this.style.backgroundColor;this.style.backgroundColor=’#EE82EE'”); //当鼠标移开时还原背景色 e.Row.Attributes.Add(“onmouse