ajaxToolkit:DropDownExtender where is items?
<asp:TextBox ID="TextBox5" runat="server" Height="30px" Width="68px"></asp:TextBox>
<ajaxToolkit:DropDownExtender ID="TextBox5_DropDownExtender" runat="server"
DynamicServicePath="" Enabled="True" TargetControlID="TextBox5">
</ajaxToolkit:DropDownExtender>
//this.TextBox5_DropDownExtender ????
YearList.Items.Add(DateTime.Today.AddYears(-i).ToString("yyyy"));
Question : where is items for this DropDownExtender ?
There's a property called DropDownControlID
on the extender. Point that to a panel and put your items there. Something like this:
<asp:TextBox ID="TextBox5" runat="server" Height="30px" Width="68px" />
<ajaxToolkit:DropDownExtender ID="TextBox5_DropDownExtender" runat="server"
DynamicServicePath="" Enabled="True" TargetControlID="TextBox5"
DropDownControlID="pnlItems" />
<asp:Panel ID="pnlItems" runat="server" BorderColor="Black" BorderWidth="1">
<asp:BulletedList ID="YearList" runat="server" />
</asp:Panel>
In code, add items to YearList.
精彩评论