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. Advertising

  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. 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. vishnu
    Replies:
    1
    Views:
    1,214
    Patrick.O.Ige
    Mar 25, 2006
  2. Mike
    Replies:
    1
    Views:
    815
  3. acadam
    Replies:
    0
    Views:
    762
    acadam
    Dec 27, 2006
  4. Elhanan
    Replies:
    5
    Views:
    359
    opalinski from opalpaweb
    Oct 3, 2006
  5. Replies:
    2
    Views:
    441
Loading...

Share This Page