在repeater中使用控件 dropdownlist,为什么页面上显示的id与服务器端设置的ID不一样??

来源:百度知道 编辑:UC知道 时间:2024/06/24 09:16:15
在repeater中添加ID为“aa”的dropdownlist控件 ,但页面上显示的ID却不再是"aa" 而是DataList_list$ctl04$aa

ct04还会随着<ItemTemplate>项增多而变化,

如何才能固定这个dropdownlist的控件呢?

DropDownList 绑定了数据源

代码:
<asp:Repeater ID="DataList_list" runat="server" >
<ItemTemplate>
.................................
</ItemTemplate>
<FooterTemplate>
<asp:DropDownList ID="aa" runat="server"></asp:DropDownList>
</FooterTemplate>
</asp:Repeater>
在js中改如何调用这个下拉列表框呢?????

<!-- js -->
var list=new Array();
var listIpt=document.getelementsByTagName("input");
function SelAll()
{
for(var i=0;i<listIpt.length;i++)
{
list[i]=listIpt.id;
}
}

DataList_list$ctl04$aa

你也注意到了,ID是和行号对应的,用JS遍历