图例:
注意,”请选择“ 的是个文本框
<asp:Label ID="TextLabel" runat="server" Text="请选择" Style="display: block; 300px; padding:2px; padding-right: 50px; font-family: Tahoma; font-size: 11px;" />
<asp:Panel ID="DropPanel" runat="server" CssClass="ContextMenuPanel" Style="display :none; visibility: hidden;">
<asp:LinkButton runat="server" ID="Option1" Text="董昊" CssClass="ContextMenuItem" OnClick="OnSelect" />
<asp:LinkButton runat="server" ID="Option2" Text="比尔盖茨" CssClass="ContextMenuItem" OnClick="OnSelect" />
<asp:LinkButton runat="server" ID="Option3" Text="二百五" CssClass="ContextMenuItem" OnClick="OnSelect" />
</asp:Panel>
<ajaxToolkit:DropDownExtender runat="server" ID="DDE"
TargetControlID="TextLabel"
DropDownControlID="DropPanel" />
<asp:Panel ID="DropPanel" runat="server" CssClass="ContextMenuPanel" Style="display :none; visibility: hidden;">
<asp:LinkButton runat="server" ID="Option1" Text="董昊" CssClass="ContextMenuItem" OnClick="OnSelect" />
<asp:LinkButton runat="server" ID="Option2" Text="比尔盖茨" CssClass="ContextMenuItem" OnClick="OnSelect" />
<asp:LinkButton runat="server" ID="Option3" Text="二百五" CssClass="ContextMenuItem" OnClick="OnSelect" />
</asp:Panel>
<ajaxToolkit:DropDownExtender runat="server" ID="DDE"
TargetControlID="TextLabel"
DropDownControlID="DropPanel" />
控件简介:
<ajaxToolkit:DropDownExtender runat="server" ID="DDE“
TargetControlID="TextLabel"
DropDownControlID="DropPanel"/>
TargetControlID="TextLabel"
DropDownControlID="DropPanel"/>
TargetControlID –需要附加下拉列表的文本框ID
DropDownControlID –下拉列表(Panel)ID