如 题!

解决方案 »

  1.   

    //你要学会结贴!!
    protected void gvBooks_RowDataBound(object sender,GridViewRowEventArgs e)
    {
        if(e.Row.RowType == DataControlRowType.DataRow)
        {
           e.Row.Attributes.Add("onmouseover",
            "currentcolor=this.style.backgroundColor;this.style.backgroundColor=#6699ff")
           e.Row.Attributes.Add("onmouseout","this.style.backgroundColor=currentcolor")
        }
    }
      

  2.   

    他说“currentcolor” 未定义!
      

  3.   

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='ivory'");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'");        }    }
      

  4.   

    protected void gvBooks_RowDataBound(object sender,GridViewRowEventArgs e)
    {
        if(e.Row.RowType == DataControlRowType.DataRow)
        {
           e.Row.Attributes.Add("onmouseover",
            "currentcolor=this.style.backgroundColor;this.style.backgroundColor=#6699ff")
           e.Row.Attributes.Add("onmouseout","this.style.backgroundColor=currentcolor")
        }
    }
      

  5.   

    //你要学会结贴!!
    protected void gvBooks_RowDataBound(object sender,GridViewRowEventArgs e)
    {
        if(e.Row.RowType == DataControlRowType.DataRow)
        {
           e.Row.Attributes.Add("onmouseover",
            "var currentcolor=this.style.backgroundColor;this.style.backgroundColor=#6699ff")
           e.Row.Attributes.Add("onmouseout","this.style.backgroundColor=currentcolor")
        }
    }
      

  6.   

     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
            {
                e.Row.Attributes.Add("onmouseover", "this.oldcolor=this.style.backgroundColor;this.style.backgroundColor='#ffffcc'");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.oldcolor;");
            }