ASP.NET DropDownList Extension

I am trying to create my own control that inherits from DropDownList.

I need to add a new property to the ListItem (in the item collection).

<cc1:MyDropDownList ID="MyDropDownList1" runat="server">   
   <asp:ListItem myProperty="true" text="sometext" ... />                     

</cc1: MyDropDownList>    

How can i do this?

+2
source share
2 answers

Even if you inherit DropDownList, you cannot add this property because you have to add it to the ListItem control.
But the problem is that the ListItem class is sealed, so you cannot inherit it.

+3
source

Can you extend the capabilities of the client side with jQuery?

0
source

Source: https://habr.com/ru/post/1763553/


All Articles