Groups | Blog | Home
all groups > asp.net webcontrols > november 2005 >

asp.net webcontrols : Custom DropDownList Control and ListItem


Vi
11/5/2005 10:50:02 AM
Hi,
I'm trying to create a custom DropDownList Control. Everything seems to be
OK until I'm adding ListItem-s to the control. I'm getting the error: " Could
not load type ControlLib.ListItem from assembly ControlLib" (ControlLib is
the project where the custom DropDown control is defined).
Here's the code:

<lib:CustomDropDownList id="list1" runat="server" BackColorOn="128, 255, 128">
<lib:ListItem Value="0" Selected="True">-- Select --</lib:ListItem>
<lib:ListItem Value="1">Value 1</lib:ListItem>
<lib:ListItem Value="2">Value 2</lib:ListItem>
<lib:ListItem Value="3">Value 3</lib:ListItem>
</lib:CustomDropDownList>

I guess I have to define ListItem in ControlLib as well, but not sure how.
Vi
11/5/2005 12:15:02 PM
I can - I tried and it worked.
I thought it does not work because if I use "asp:ListItem", VS.NET 2003
underlines asp:ListItem with the error message "The active schema does not
support the element 'asp:ListItem'".
But I tried it anyway and it worked.
Thanks

[quoted text, click to view]
Abraham Luna
11/5/2005 2:39:41 PM
can you just add the asp:listitem instead
or do you have a custom listitem?


[quoted text, click to view]

AddThis Social Bookmark Button