|
-
Apr 8th, 2004, 02:24 PM
#1
Thread Starter
New Member
Help caputuring properties in dynamic controls on postback
I declared a placeholder on a web form and I add dropdownlists to it dynamically (dont know how many at any given time). How do I get the results out on the next postback? Am I missing an event to trap the values with? Every time I try (like in the post buttons click event, I am missing the selected values.)
HERE IS THE GENERATING CODE
For Each item As System.Web.UI.WebControls.ListItem In CheckBoxList1.Items
If item.Selected Then
Results1 += item.Value & ";"
Dim Name As New Label
Name.Text = item.Text & "<br>"
Dim CatLink As New DropDownList
CatLink.Items.Add("1")
CatLink.Items.Add("2")
CatLink.Items.Add("3")
CatLink.Items.Add("4")
CatLink.Items.Add("5")
CatLink.ID = item.Value
Me.PlaceHolderQ2.Controls.Add(Name)
End IF
Next item
HERE I AM TRYING TO READ THE VALUES
Dim myresults As String
For Each cont As Control In Me.PlaceHolderQ2.Controls
Try
'Dim drop As New DropDownList
myresults += CType(cont, DropDownList).SelectedValue & ";"
Catch ex As Exception
End Try
Next
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|