best practive with dropdown list controls in user controls

Discussion in 'ASP .Net Web Controls' started by dma, Apr 20, 2006.

  1. dma

    dma Guest

    Hi all

    I have a situation where I have a composite web user control which
    centralizes a db lookup. I am having a problem where it seems viewstate is
    being voided and it always loses it's selected index. I have properly
    wrapped the ispostback, so I am sure it is not getting overwritten that way.
    What is most frustrating is that if I move the control out of the web user
    control, call it "userlist" and into the web user control that collects
    controls into an edit panel, it works like a charm.

    Are there some special properties or atttributes I need to put into my list
    style user control for it to persist the selection?

    Thanks in advance, this is making me nuts, and making a mess of my project
    as I create stand alone versions of the nice web user controls that present
    common lookup information.

    Thanks!

    -DMA
     
    dma, Apr 20, 2006
    #1
    1. Advertisements

  2. Have you looked at overriding your custom controls Viewstate mechanism.
    So that you can store the selected index yourself and control this
    yourself?

    Issues like this can drive you insane sometimes it is better to take
    full control of the situation by writing the code yourself, i've had
    some nightmares with custom web controls and this sort of thing.
     
    Peter Johnson, Apr 22, 2006
    #2
    1. Advertisements

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. Luis E Valencia

    Re: User Input in Dropdown List

    Luis E Valencia, May 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,035
    Dan Brussee
    May 17, 2004
  2. Iams
    Replies:
    1
    Views:
    431
    Wilco Bauwer
    Feb 17, 2005
  3. Dica
    Replies:
    4
    Views:
    910
  4. Elhanan
    Replies:
    5
    Views:
    423
    opalinski from opalpaweb
    Oct 3, 2006
  5. =?Utf-8?B?QnJlbmRlbiBCaXhsZXI=?=

    Dropdown List - Check if value exists in list prior to selection

    =?Utf-8?B?QnJlbmRlbiBCaXhsZXI=?=, Mar 10, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    2,226
    =?Utf-8?B?QnJlbmRlbg==?=
    Mar 20, 2007
  6. blouie
    Replies:
    6
    Views:
    432
    blouie
    Mar 29, 2007
  7. jm
    Replies:
    0
    Views:
    361
  8. Replies:
    1
    Views:
    414
Loading...