DropDownList Problem

R

radhakrishnan

Hello All,

In a webform i have one dropdownlist and One textbox

user can select the particular item from the dropdownlist and
enter value in the
textbox.

finally he click submit button the entered data are to stored in
a database.


ex. selection of first item in dropdownlist user enters the
textbox1="HELLO"
selection of second item in dropdown user enters the
textbox1="WELCOME"
Onclicking the submit button HELLO,WELCOME both should to be
stored.

I am making dropdownlist.AutoPostBack="true"
To do this i am using the onselectedindexchanged as given below.

dim htList as new Hashtable
sub change(sender as object,e as eventagrs)
textbox1.text="HELLO"
htList.add(dropdownlist.selectedindex,textbox1.text)
end sub

i am using a hash table to store these values. But only the last
selectedindex value is available in hashtable.
Is there any way to get all the values entered by the user
onselecedindexchaged.

thanks in advance
 
C

CMA

when u declare the variable use "Shared"

like
Shared htList as new Hashtable

it will available as static. so make ur life easier...

regards,
CMA
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top