gridview模版列设置鼠标移过时背景图片
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
HtmlTable tb = (HtmlTable)e.Row.FindControl("tb1");
string tb_bg="background=\"img/pic_zwgk.jpg\"";
tb.Attributes.Add("onmouseover", tb_bg);
tb.Attributes.Add("onmouseout", "background=\"\"");
}
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
HtmlTable tb = (HtmlTable)e.Row.FindControl("tb1");
string tb_bg="background=\"img/pic_zwgk.jpg\"";
tb.Attributes.Add("onmouseover", tb_bg);
tb.Attributes.Add("onmouseout", "background=\"\"");
}
}
posted on 2006-10-16 20:53 醒了又睡的鱼.NET 阅读(345) 评论(0) 编辑 收藏 举报