DanielSchaffer
May 26th, 2005, 01:04 PM
I've got a statically defined, dynamically populated ListBox control and I'm having trouble keeping its state during a postback.
The ListBox is a point of contact list that the user populates by selecting from a list of users in a popup window. When the user clicks the "select" button, the highlighted items in the popup window are added to the ListBox in question using client side javascript.
The problem is, if the page does a postback (either submitting or on account of a different control), everything that was populated dissapears.
I've had this problem before and usually get around it by using cookies, session variables or the Request.Form object, but I know that these are all workarounds. What is the right way to solve this problem?
The ListBox is a point of contact list that the user populates by selecting from a list of users in a popup window. When the user clicks the "select" button, the highlighted items in the popup window are added to the ListBox in question using client side javascript.
The problem is, if the page does a postback (either submitting or on account of a different control), everything that was populated dissapears.
I've had this problem before and usually get around it by using cookies, session variables or the Request.Form object, but I know that these are all workarounds. What is the right way to solve this problem?