Move Items Between 2 ListBoxes???

Rothariger

Regular
Joined
Apr 7, 2004
Messages
66
hello, i must to make that, i have found this code that acomplish that, but, when i make the postback i loose all that i have done... how can i make so the changes are still there after the postback???

im making this little example for make a try... but at the postback i loose all data...

Visual Basic:
 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Introducir aquí el código de usuario para inicializar la página
        If Not IsPostBack Then
            ListBox1.Items.Add(New System.Web.UI.WebControls.ListItem("Uno", 10))
            ListBox1.Items.Add(New System.Web.UI.WebControls.ListItem("Dos", 20))
            ListBox1.Items.Add(New System.Web.UI.WebControls.ListItem("Tres", 30))
            ListBox2.Items.Add(New System.Web.UI.WebControls.ListItem("Cien", 100))
            ListBox2.Items.Add(New System.Web.UI.WebControls.ListItem("Doscientos", 200))
            ListBox2.Items.Add(New System.Web.UI.WebControls.ListItem("Trescientos", 300))
        End If
        Button1.Attributes.Add("onclick", "javascript:return pasaraderecha();")
        Button2.Attributes.Add("onclick", "javascript:return pasaraizquierda();")


thanks and salutes!!!
 
I dont remember wich option exactly needs to be set , but I know there's a property that makes the listboxes keep their data... look into the property box of your listboxes...
 
Back
Top