javascript and asp:listbox

  • Thread starter Gunnar Stefansson
  • Start date
G

Gunnar Stefansson

Hihi

I'm using að <asp:listbox /> and adding items in it with
client side javascript. When i submit the code and try
to get the items out of it. It seems like the form is posted
before and the form does not remember it's items.

Anyone
Gunnar Stefansson
(e-mail address removed)
 
D

Duray AKAR

You can only get the selected value(s) in the list from
the
Response["ListBoxName"]...

On the serverside, the controls are regenerated using the
ViewState values posted from the client to maintain state
informaton.

If you fill the listbox with javascript on the client side
those values are never entered in the encoded viewstate
variables, so you can definitely NOT get them back on the
server...

Only thing you can get is the value of the selected Item
in the list like in tha old asp days...

Hope it helps

Duray AKAR
 
O

onderA

Hi Duran,

there should be a way to get back the selection on the
server! Do you advise anything for that?
-----Original Message-----
You can only get the selected value(s) in the list from
the
Response["ListBoxName"]...

On the serverside, the controls are regenerated using the
ViewState values posted from the client to maintain state
informaton.

If you fill the listbox with javascript on the client side
those values are never entered in the encoded viewstate
variables, so you can definitely NOT get them back on the
server...

Only thing you can get is the value of the selected Item
in the list like in tha old asp days...

Hope it helps

Duray AKAR

-----Original Message-----
Hihi

I'm using að <asp:listbox /> and adding items in it with
client side javascript. When i submit the code and try
to get the items out of it. It seems like the form is posted
before and the form does not remember it's items.

Anyone
Gunnar Stefansson
(e-mail address removed)


.
.
 

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,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top