get the value of dropdownList

W

Wen Ou

hi

i got a problem about dropdownlist. i set autopostback true. when its index
changed, i would like to get its value before changed and compare with the
value after changed. i don't have any idear about that.

anyone can help me

thank you

wen ou
 
M

Michael Baltic

Create a new control and inherit from the dropdownlist. Add a property for
the previous value.

When the dropdownlist is filled with items, set the previos value to null.
All other times, just put the current value into the previous value AFTER you
read the contents of the previous value.

Make sure the value is persisted in state.
 
W

Wen Ou

Hi Michael
thank you for your respondance
i still don't understand your answer. could you give me more details please

thank you
wen ou
 
M

Michael Baltic

Do you know how to create an inherited control? If not, I can give you some
sample code.

My email user id is Michael.Baltic the domain is NCMC.com (That should stop
an automated spammer?)

If you don't want to create an inherited control, you can use session
variables to save the value. Each time you read the current value, save it
to the previous value (after you read the contents of the previous value)
 
W

Wen Ou

i don't like to use session variable. could you give some sample code of
inherited control please

thank you

wen ou
 

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,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top