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=\"\"");
        }
  
    }

你可能感兴趣的:(GridView)