复制代码 代码如下:
protected void gvwNews_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "color = this.style.backgroundColor;this.style.backgroundColor='#EAFCD5'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=color");
e.Row.Attributes.Add("onclick", "ClickRow()");
}
}
复制代码 代码如下:
function ClickRow()
{
var obj = event.srcElement.parentElement.firstChild.firstChild.tagName;
alert(obj);
if(obj!=null && obj.tagName+""!="undefined")
{
obj.checked=obj.checked ? false : true;
}
}
新闻热点
疑难解答
图片精选