best practive with dropdown list controls in user controls

D

dma

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
 
P

Peter Johnson

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,052
Latest member
KetoBeez

Latest Threads

Top