熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

為GridView的行添加鼠標經過、點擊的事件。

2022-06-13   來源: .NET編程 
   protected void GridView_RowDataBound(object sender GridViewRowEventArgs e)
    {
        eRowAttributesAdd(onmouseover c=thisstylebackgroundColor;thisstylebackgroundColor=#BFF);
        eRowAttributesAdd(onmouseout thisstylebackgroundColor=c);
        eRowAttributes[style] = Cursor:hand;
        int count = GridViewRowsCount;
        string ID = ;
        for (int i = ; i < count; i++)
        {
            ID = GridViewDataKeys[i]ValueToString();
            GridViewRows[i]AttributesAdd(onclick newwin=windowopen(defaultaspx?ID= + ID + newwinwidth=height=));
        }
    }
From:http://tw.wingwit.com/Article/program/net/201311/13830.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.