GridView奇怪的问题
先说明效果:
当鼠标在GridView的行上划过的时候,页面显示出相应行的内,但是项的内容是非数字的时候,不能显示
代码如下:[code=C#]
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
string res = e.Row.Cells[0].Text.ToString();
if (e.Row.RowType == DataControlRowType.DataRow)
{
//当鼠标加载的时候,在页面下方显示详细信息
e.Row.Attributes.Add("onmouseover", "document.getElementById(\"newsInfo\").innerHTML=" + res + "");
//在客户端动态的显示内容
}
}[code]