GridView控件的光棒效应
1 // 光棒效应 2 protected void gvBookInfos_RowDataBound(object sender, GridViewRowEventArgs e) 3 { 4 if(e.Row.RowType==DataControlRowType.DataRow) 5 { 6 e.Row.Attributes.Add("onmouseover", "currentColor=this.style.backgroundColor;this.style.backgroundColor='yellow'"); 7 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentColor"); 8 } 9 }