如何获取内部转发器控制中的下拉列表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..:)