如何获取内部转发器控制中的下拉列表ID [英] how to get dropdown id which is inside repeater Control
本文介绍了如何获取内部转发器控制中的下拉列表ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的朋友
我在Javascript中获取下拉列表ID 中遇到问题在转发器控件中..
i已经尝试了但是它不能正常工作
Dear Friends
I am having problem in getting dropdownlist Id which is in Repeater Control in Javascript..
i have tried it but it is not working
<script type="text/javascript">
function ShowDDl() {
var id = document.getElementById("<%= ChangeQuantityDDL.ClientID %>")
}
</script>
它给我一个错误当前不存在ChangeQuantityDDL nt context
it gives me an Error that ChangeQuantityDDL do not exist in current context
<asp:Repeater ID="ItemListDL" runat="server" >
<ItemTemplate>
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text='<%#Eval("Quantity")%>'></asp:Label><a href="#" önclick="javascript:ShowDDl();"> Change</a><asp:DropDownList ID="ChangeQuantityDDL" runat="server" Visible="false">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
<asp:ListItem>11</asp:ListItem>
<asp:ListItem>12</asp:ListItem>
<asp:ListItem>13</asp:ListItem>
<asp:ListItem>14</asp:ListItem>
<asp:ListItem>15</asp:ListItem>
</asp:DropDownList></td>
<td>
请尽快给我解决方案..
先谢谢你..
please give me soluton for this as soon as possible..
Thanks in Advance..
推荐答案
请参阅此链接。这与你的目标有些相关。
获取在转发器中绑定的特定用户控件的ClientID [ ^ ]
问候..:)
Refer to this link. It is somewhat relevant to what you are aimed at.
get ClientID for a specific user control bounded in a repeater[^]
Regards..:)
这篇关于如何获取内部转发器控制中的下拉列表ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文