Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Custom DropDownList Control and ListItem

Reply
Thread Tools

Custom DropDownList Control and ListItem

 
 
Vi
Guest
Posts: n/a
 
      11-05-2005
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.
Thank you in advance
 
Reply With Quote
 
 
 
 
Abraham Luna
Guest
Posts: n/a
 
      11-05-2005
can you just add the asp:listitem instead
or do you have a custom listitem?


"Vi" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
> Thank you in advance



 
Reply With Quote
 
 
 
 
Vi
Guest
Posts: n/a
 
      11-05-2005
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

"Abraham Luna" wrote:

> can you just add the asp:listitem instead
> or do you have a custom listitem?
>
>
> "Vi" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.
> > Thank you in advance

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bound dropdownlist inside DetailsView control not displaying ListItem added via Insert() donet programmer ASP .Net 0 10-25-2007 04:55 PM
Custom control intellisense to work like DropDownList/ListItem? Dave ASP .Net Building Controls 0 08-17-2007 01:19 AM
<asp:ListItem Value="0">blank choice</asp:ListItem> ? Jim in Arizona ASP .Net 7 11-22-2006 08:31 AM
Inserting a default ListItem in DropDownList Control =?Utf-8?B?QW1pIFNjaHJlaWJlcg==?= ASP .Net 1 01-13-2006 11:49 PM
ropdownlist listitem.value not working - returns listitem.text instead Mad Scientist Jr ASP .Net 2 06-29-2004 01:13 PM



Advertisments