js 获取选中的checkbox的行的其他值

//aspx.cs
        protected   void   GridView1_RowDataBound(object   sender,   GridViewRowEventArgs   e)
        {
                if   (e.Row.RowType   ==   DataControlRowType.DataRow)
                {
                        CheckBox   chkSelect   =   (CheckBox)e.Row.FindControl( "chkSelect ");
                        chkSelect.Attributes.Add( "onclick ",   "show   ( ' "   +   e.Row.RowIndex   +   " ') ");
                }
        }
//aspx页添加脚本
        function   show(index) 
       { 
             var   table   =   document.getElementById( "GridView1 "); 
             for(var   i   =   1;   i   <   table.rows[0].cells.length;   i++)

             { 
                        alert   (table.rows[index   +   1].cells[i].innerText); 
             }

             return   false; 
        }    

posted @ 2009-02-17 10:44  jenner  阅读(2064)  评论(0编辑  收藏  举报