Composite Control Problem - ListBox

Discussion in 'ASP .Net Web Controls' started by Mike Dando, Dec 6, 2004.

  1. Mike Dando

    Mike Dando Guest

    Hi,

    I have created a composite control which has some drop down lists, buttons
    and a list box. The button clicks add items from the drop down lists to the
    list box, but the list box only ever shows with 1 (the latest) value.
    From what I have read, a ListBox does not store viewstate with regards to
    items added to it.

    So how can I maintain the list of items in my ListBox between trips to the
    server? As this is a composite
    control I would expect any solution to be within my new control's class and
    not at the page level.

    I have looked at the LoadViewState/SaveViewState methods but they don't seem
    to get called.

    Thanks,

    Mike.

    ..NET 2003 C#
     
    Mike Dando, Dec 6, 2004
    #1
    1. Advertising

  2. Mike Dando

    Mike Dando Guest

    If I put the same controls and code in a WebUserControl, the ListBox items
    do appear
    to maintan state.


    "Mike Dando" <> wrote in message
    news:...
    > Hi,
    >
    > I have created a composite control which has some drop down lists, buttons
    > and a list box. The button clicks add items from the drop down lists to
    > the list box, but the list box only ever shows with 1 (the latest) value.
    > From what I have read, a ListBox does not store viewstate with regards to
    > items added to it.
    >
    > So how can I maintain the list of items in my ListBox between trips to the
    > server? As this is a composite
    > control I would expect any solution to be within my new control's class
    > and not at the page level.
    >
    > I have looked at the LoadViewState/SaveViewState methods but they don't
    > seem to get called.
    >
    > Thanks,
    >
    > Mike.
    >
    > .NET 2003 C#
    >
     
    Mike Dando, Dec 7, 2004
    #2
    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. sleigh
    Replies:
    1
    Views:
    2,737
    sleigh
    Feb 12, 2004
  2. Replies:
    1
    Views:
    368
  3. Rory

    Composite ListBox Control

    Rory, Jul 29, 2003, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    127
  4. Chad
    Replies:
    0
    Views:
    253
  5. Peter S.

    Composite dropdownlist control that also displays a listbox????

    Peter S., Nov 21, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    174
    Peter S.
    Nov 21, 2005
Loading...

Share This Page