国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

為GridView的行添加鼠標經過、點擊事件的小例子

2024-07-10 13:15:07
字體:
來源:轉載
供稿:網友

復制代碼 代碼如下:


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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 横峰县| 龙川县| 海原县| 收藏| 南通市| 南昌县| 独山县| 克拉玛依市| 潞城市| 宝清县| 常德市| 宜丰县| 保德县| 若羌县| 西昌市| 界首市| 延安市| 西平县| 紫云| 安达市| 宜川县| 扎赉特旗| 咸阳市| 城市| 房产| 台中县| 甘泉县| 当雄县| 大埔区| 博野县| 三河市| 巴塘县| 诸暨市| 突泉县| 兰坪| 广西| 瑞金市| 枣阳市| 云龙县| 论坛| 万山特区|