サーバーコントロールとクライアントスクリプトで使用する要素IDの結びつけ
GridViewなんかだと
GridView1_001_xxx_ctl1_hoge
とかになる。
GridView = function(id){ this.element = document.getElementById(id); } GridView.prototype = { getRowId : function(rowNum){ return element.id + rowNum ; }, getRowElement: function(rowNum){ return document.getElementById(this.getRowId() ); } ,getRows : function(){ return this.element.firstChild.childNodes; //firstChildにtbodyが設定されているはず } }
とかすればいい?