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

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

2013-11-13 10:30:04  來源: .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-2013 電腦知識網 Computer Knowledge   All rights reserved.