日期:2014-05-19  浏览次数:20787 次

关于Repeater与DataBinder同时使用取控件ID的问题?急
<asp:Repeater   id= "repeaterData "   runat= "server ">
<ItemTemplate>
<tr>
<td   align= "center "     width= "15% "   class= "tdbg "> <input   type= "checkbox "   name= "selectname "   > </td>
<td   align= "center "   class= "tdbg "   width= "85% "> <asp:label   ID= "valueLabel "   runat= "server "   Text= ' <%#DataBinder.Eval(Container.DataItem,   "SECOND ")%> '> </asp:label> </td>
</tr>
</ItemTemplate>
</asp:Repeater>

上面的是asp代码
下面的是html的页面解析:
<tr>
<td   align= "center "     width= "15% "   class= "tdbg "> <input   type= "checkbox "   name= "selectname "   > </td>
<td   align= "center "   class= "tdbg "   width= "85% "> <span   id= "repeaterData_ctl00_valueLabel "> 20.3 </span> </td>
</tr>
...
<tr>
<td   align= "center "     width= "15% "   class= "tdbg "> <input   type= "checkbox "   name= "selectname "   > </td>
<td   align= "center "   class= "tdbg "   width= "85% "> <span   id= "repeaterData_ctl08_valueLabel "> 10 </span> </td>
</tr>

现在我想在asp代码中嵌入js,取这个list里的label控件的值,
应该怎么做啊,页面解析出来的代码,label代码变成了span,
也没有value这一项,我怎么做都取不到值啊?
求救!

------解决方案--------------------
alert(document.getElementById( "repeaterData_ctl08_valueLabel ").innerText);