Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi, I'm working on a clothing website and what im trying to do is have a listbox of sizes for each colour an item has. I create the listboxes dynamically based on the number of colours which works fine but I dont know how to access them when I try to add their selected items to the order.

 

Could someone explain how I can access those controls and find each item that has been selected? I've pasted the code for creating the controls below.

 

Thank you

 

 

Dim lbxdynamicsizes As ListBox

 

For i = 0 To chkcolours.Items.Count - 1

 

lbxdynamicsizes = New ListBox()

lbxdynamicsizes.ID = "lbxsize" & i

lbxdynamicsizes.SelectionMode = ListSelectionMode.Multiple

lbxdynamicsizes.Rows = 2

lbxdynamicsizes.DataSource = ds.Tables(1)

lbxdynamicsizes.DataTextField = "sizes"

 

panelsizes.Controls.Add(lbxdynamicsizes)

Dim spacer As LiteralControl = New LiteralControl("<br>")

panelsizes.Controls.Add(spacer)

You can not get ye flask.
  • Moderators
Posted

Inside the loop, add an event handler for those controls.

Then add a method/function to handle the event.

 

 

And I would place this line outside the loop...

Dim spacer As LiteralControl = New LiteralControl("<br>")

Visit...Bassic Software

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