开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜