Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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...

 

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!!!

Posted
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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...