Custom DropDownList Control and ListItem

Discussion in 'ASP .Net Web Controls' started by Vi, Nov 5, 2005.

  1. Vi

    Vi Guest

    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
    Vi, Nov 5, 2005
    #1
    1. Advertising

  2. Vi

    Abraham Luna Guest

    can you just add the asp:listitem instead
    or do you have a custom listitem?


    "Vi" <> wrote in message
    news:...
    > 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
    Abraham Luna, Nov 5, 2005
    #2
    1. Advertising

  3. Vi

    Vi Guest

    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" <> wrote in message
    > news:...
    > > 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

    >
    >
    >
    Vi, Nov 5, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mad Scientist Jr
    Replies:
    2
    Views:
    429
    Mad Scientist Jr
    Jun 29, 2004
  2. =?Utf-8?B?QW1pIFNjaHJlaWJlcg==?=

    Inserting a default ListItem in DropDownList Control

    =?Utf-8?B?QW1pIFNjaHJlaWJlcg==?=, Jan 13, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    398
  3. Jim in Arizona
    Replies:
    7
    Views:
    904
    Badass Scotsman
    Nov 22, 2006
  4. donet programmer
    Replies:
    0
    Views:
    785
    donet programmer
    Oct 25, 2007
  5. Dave
    Replies:
    0
    Views:
    914
Loading...

Share This Page