ASP.net onmouseover

来源:百度知道 编辑:UC知道 时间:2024/05/25 04:41:10
onmouseover="style='background-color:#000000'" 这句那里错了?怎么鼠标移进去了没有反应,左下角说网页有错!
或 鼠标移进去class换个名字。。。

onmouseover="this.style.backgroundColor='#00000'"

看你是在前台还是后台实现

前台:onmouseover="this.style.backgroundColor='red'

后台:

protected void GridView1_RowDataBound1(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover","curentcolor=this.style.background='red'");
e.Row.Attributes.Add("onmouseout", "this.style.background='curentcolor'");
}
}

onmouseover="style.background-color='#000000';"