asp.net gridview onmouseover與onmouseout事件(變底色)

摘要:asp.net gridview onmouseover與onmouseout事件(變底色)

 

 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (GridView1.HeaderRow != null)
        {
            e.Row.Attributes.Add("onMouseOver", "this.style.backgroundColor='red'");
            e.Row.Attributes.Add("onMouseOut", "this.style.backgroundColor='white'");
        }
    }