源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

为GridView的行添加鼠标经过、点击事件的小例子

  • 时间:2020-09-25 15:01 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:为GridView的行添加鼠标经过、点击事件的小例子
[u]复制代码[/u] 代码如下:
   protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)     {         e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#95B8FF'");         e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");         e.Row.Attributes["style"] = "Cursor:hand";         int count = GridView1.Rows.Count;         string ID = "";         for (int i = 0; i < count; i++)         {             ID = GridView1.DataKeys[i].Value.ToString();             GridView1.Rows[i].Attributes.Add("onclick", "newwin=window.open('default3.aspx?ID=" + ID + "','newwin','width=500,height=550')");         }     }       
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部