Monday, March 26, 2012

Populate a Listbox by using JavaScript

Hi,

I have a page with a ListBox on it, and It's also have a some buttons to
populate the ListBox by using JavaScript.
I have no problem with populate the listbox using JavaScript. But when the
page is submited / postback, the listbox is still empty.

Do you have any solution for this case (if I still want to use ListBox
Server Control) ?

thanks,
Devin WoodDevin,

You need to pass the new items to the server. It can be done in a hidden
input html control. On server side you will parse the input's value and
populate the listbox.

Eliyahu

"Devin Wood" <nordlitch@.msn.com> wrote in message
news:Opwr1avLFHA.2648@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I have a page with a ListBox on it, and It's also have a some buttons to
> populate the ListBox by using JavaScript.
> I have no problem with populate the listbox using JavaScript. But when the
> page is submited / postback, the listbox is still empty.
> Do you have any solution for this case (if I still want to use ListBox
> Server Control) ?
> thanks,
> Devin Wood

0 comments:

Post a Comment