Hey there, I'm working on an ASP.NET project and I have a dropdownlist that contains multiple items. I am looking to implement functionality where I can hide or show all the items in the dropdownlist based on user interaction.
<asp:DropDownList id="DropDownList1" runat="server">
<asp:listitem value="">Select one</asp:listitem>
<asp:listitem value="1">Item 1</asp:listitem>
<asp:listitem value="2">Item 2</asp:listitem>
<asp:listitem value="3">Item 3</asp:listitem>
<asp:listitem value="4">Item 4</asp:listitem>
<asp:listitem value="5">Item 5</asp:listitem>
<asp:listitem value="6">Item 6</asp:listitem>
<asp:listitem value="7">Item 7</asp:listitem>
<asp:listitem value="8">Item 8</asp:listitem>
<asp:listitem value="9">Item 9</asp:listitem>
<asp:listitem value="10">Item 10</asp:listitem>
</asp:DropDownList>
I need to add two buttons - btnHideAll to hide all items and btnShowAll to display all items upon clicking either button.