protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { //整行连接 if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#d3d7d4'"); //鼠标移进改变背景色 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor"); //鼠标移出恢复背景色 e.Row.Attributes.Add("onclick", "alert('ddd" + e.Row.Cells[1].Text + "');location.href('dddd.aspx?hhh="+ e.Row.Cells[1].Text +"');"); //点击行连接 }